Skip to content

Commit fdcaf13

Browse files
committed
DOC: give deprecation warning about future timeseries broadcasting behavior
DOC/CLN: cleanup
1 parent 359c736 commit fdcaf13

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

doc/source/dsintro.rst

+11-7
Original file line numberDiff line numberDiff line change
@@ -482,19 +482,23 @@ column-wise:
482482
.. ipython:: python
483483
484484
index = date_range('1/1/2000', periods=8)
485-
df = DataFrame(randn(8, 3), index=index,
486-
columns=['A', 'B', 'C'])
485+
df = DataFrame(randn(8, 3), index=index, columns=list('ABC'))
487486
df
488487
type(df['A'])
489488
df - df['A']
490489
491-
Technical purity aside, this case is so common in practice that supporting the
492-
special case is preferable to the alternative of forcing the user to transpose
493-
and do column-based alignment like so:
490+
.. warning::
494491

495-
.. ipython:: python
492+
.. code-block:: python
493+
494+
df - df['A']
495+
496+
is now deprecated and will be removed in a future release. The preferred way
497+
to replicate this behavior is
498+
499+
.. code-block:: python
496500
497-
(df.T - df['A']).T
501+
df.sub(df['A'], axis=0)
498502
499503
For explicit control over the matching and broadcasting behavior, see the
500504
section on :ref:`flexible binary operations <basics.binop>`.

0 commit comments

Comments
 (0)