You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(``mode`` being one of ``tarfile.open``'s modes: https://docs.python.org/3/library/tarfile.html#tarfile.open)
126
+
127
+
103
128
.. _whatsnew_150.enhancements.other:
104
129
105
130
Other enhancements
@@ -120,7 +145,7 @@ Other enhancements
120
145
- :meth:`DataFrame.reset_index` now accepts a ``names`` argument which renames the index names (:issue:`6878`)
121
146
- :meth:`pd.concat` now raises when ``levels`` is given but ``keys`` is None (:issue:`46653`)
122
147
- :meth:`pd.concat` now raises when ``levels`` contains duplicate values (:issue:`46653`)
123
-
- Added ``numeric_only`` argument to :meth:`DataFrame.corr`, :meth:`DataFrame.corrwith`, :meth:`DataFrame.cov`, :meth:`DataFrame.idxmin`, :meth:`DataFrame.idxmax`, :meth:`.GroupBy.idxmin`, :meth:`.GroupBy.idxmax`, :meth:`.GroupBy.var`, :meth:`.GroupBy.std`, :meth:`.GroupBy.sem`, and :meth:`.GroupBy.quantile` (:issue:`46560`)
148
+
- Added ``numeric_only`` argument to :meth:`DataFrame.corr`, :meth:`DataFrame.corrwith`, :meth:`DataFrame.cov`, :meth:`DataFrame.idxmin`, :meth:`DataFrame.idxmax`, :meth:`.DataFrameGroupBy.idxmin`, :meth:`.DataFrameGroupBy.idxmax`, :meth:`.GroupBy.var`, :meth:`.GroupBy.std`, :meth:`.GroupBy.sem`, and :meth:`.DataFrameGroupBy.quantile` (:issue:`46560`)
124
149
- A :class:`errors.PerformanceWarning` is now thrown when using ``string[pyarrow]`` dtype with methods that don't dispatch to ``pyarrow.compute`` methods (:issue:`42613`, :issue:`46725`)
125
150
- Added ``validate`` argument to :meth:`DataFrame.join` (:issue:`46622`)
126
151
- A :class:`errors.PerformanceWarning` is now thrown when using ``string[pyarrow]`` dtype with methods that don't dispatch to ``pyarrow.compute`` methods (:issue:`42613`)
@@ -194,10 +219,47 @@ did not have the same index as the input.
Across the DataFrame operations such as ``min``, ``sum``, and ``idxmax``, the default
497
+
value of the ``numeric_only`` argument, if it exists at all, was inconsistent.
498
+
Furthermore, operations with the default value ``None`` can lead to surprising
499
+
results. (:issue:`46560`)
500
+
501
+
.. code-block:: ipython
502
+
503
+
In [1]: df = pd.DataFrame({"a": [1, 2], "b": ["x", "y"]})
504
+
505
+
In [2]: # Reading the next line without knowing the contents of df, one would
506
+
# expect the result to contain the products for both columns a and b.
507
+
df[["a", "b"]].prod()
508
+
Out[2]:
509
+
a 2
510
+
dtype: int64
511
+
512
+
To avoid this behavior, the specifying the value ``numeric_only=None`` has been
513
+
deprecated, and will be removed in a future version of pandas. In the future,
514
+
all operations with a ``numeric_only`` argument will default to ``False``. Users
515
+
should either call the operation only with columns that can be operated on, or
516
+
specify ``numeric_only=True`` to operate only on Boolean, integer, and float columns.
517
+
518
+
In order to support the transition to the new behavior, the following methods have
519
+
gained the ``numeric_only`` argument.
520
+
521
+
- :meth:`DataFrame.corr`
522
+
- :meth:`DataFrame.corrwith`
523
+
- :meth:`DataFrame.cov`
524
+
- :meth:`DataFrame.idxmin`
525
+
- :meth:`DataFrame.idxmax`
526
+
- :meth:`.DataFrameGroupBy.idxmin`
527
+
- :meth:`.DataFrameGroupBy.idxmax`
528
+
- :meth:`.GroupBy.var`
529
+
- :meth:`.GroupBy.std`
530
+
- :meth:`.GroupBy.sem`
531
+
- :meth:`.DataFrameGroupBy.quantile`
532
+
429
533
.. _whatsnew_150.deprecations.other:
430
534
431
535
Other Deprecations
@@ -448,6 +552,7 @@ Other Deprecations
448
552
- Deprecated passing arguments as positional in :meth:`DataFrame.any` and :meth:`Series.any` (:issue:`44802`)
449
553
- Deprecated the ``closed`` argument in :meth:`interval_range` in favor of ``inclusive`` argument; In a future version passing ``closed`` will raise (:issue:`40245`)
450
554
- Deprecated the methods :meth:`DataFrame.mad`, :meth:`Series.mad`, and the corresponding groupby methods (:issue:`11787`)
555
+
- Deprecated positional arguments to :meth:`Index.join` except for ``other``, use keyword-only arguments instead of positional arguments (:issue:`46518`)
- Bug in :meth:`Rolling.var` and :meth:`Rolling.std` would give non-zero result with window of same values (:issue:`42064`)
630
735
- Bug in :meth:`.Rolling.var` would segfault calculating weighted variance when window size was larger than data size (:issue:`46760`)
631
736
- Bug in :meth:`Grouper.__repr__` where ``dropna`` was not included. Now it is (:issue:`46754`)
737
+
- Bug in :meth:`DataFrame.rolling` gives ValueError when center=True, axis=1 and win_type is specified (:issue:`46135`)
632
738
- Bug in :meth:`.DataFrameGroupBy.describe` and :meth:`.SeriesGroupBy.describe` produces inconsistent results for empty datasets (:issue:`41575`)
633
739
740
+
634
741
Reshaping
635
742
^^^^^^^^^
636
743
- Bug in :func:`concat` between a :class:`Series` with integer dtype and another with :class:`CategoricalDtype` with integer categories and containing ``NaN`` values casting to object dtype instead of ``float64`` (:issue:`45359`)
0 commit comments