Skip to content

Commit d60465e

Browse files
committed
DOC: More 0.22.0 updates (pandas-dev#19002)
[ci skip] (cherry picked from commit d7008b8)
1 parent 8abe8c2 commit d60465e

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

doc/source/whatsnew/v0.21.0.txt

+6
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,12 @@ Additionally, support has been dropped for Python 3.4 (:issue:`15251`).
372372
Sum/Prod of all-NaN or empty Series/DataFrames is now consistently NaN
373373
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
374374

375+
.. note::
376+
377+
The changes described here have been partially reverted. See
378+
the :ref:`v0.22.0 Whatsnew <whatsnew_0220>` for more.
379+
380+
375381
The behavior of ``sum`` and ``prod`` on all-NaN Series/DataFrames no longer depends on
376382
whether `bottleneck <http://berkeleyanalytics.com/bottleneck>`__ is installed, and return value of ``sum`` and ``prod`` on an empty Series has changed (:issue:`9422`, :issue:`15507`).
377383

doc/source/whatsnew/v0.22.0.txt

+23
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,26 @@ returns ``0``.
218218

219219
The default behavior of ``min_periods=None``, implying that ``min_periods``
220220
equals the window size, is unchanged.
221+
222+
Compatibility
223+
~~~~~~~~~~~~~
224+
225+
If you maintain a library that should work across pandas versions, it
226+
may be easiest to exclude pandas 0.21 from your requirements. Otherwise, all your
227+
``sum()`` calls would need to check if the ``Series`` is empty before summing.
228+
229+
With setuptools, in your ``setup.py`` use::
230+
231+
install_requires=['pandas!=0.21.*', ...]
232+
233+
With conda, use
234+
235+
.. code-block:: yaml
236+
237+
requirements:
238+
run:
239+
- pandas !=0.21.0,!=0.21.1
240+
241+
Note that the inconsistency in the return value for all-*NA* series is still
242+
there for pandas 0.20.3 and earlier. Avoiding pandas 0.21 will only help with
243+
the empty case.

pandas/core/generic.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -7133,8 +7133,7 @@ def _doc_parms(cls):
71337133
----------
71347134
axis : %(axis_descr)s
71357135
skipna : boolean, default True
7136-
Exclude NA/null values. If an entire row/column is NA or empty, the result
7137-
will be NA
7136+
Exclude NA/null values when computing the result.
71387137
level : int or level name, default None
71397138
If the axis is a MultiIndex (hierarchical), count along a
71407139
particular level, collapsing into a %(name1)s
@@ -7268,7 +7267,7 @@ def _doc_parms(cls):
72687267
The required number of valid values to perform the operation. If fewer than
72697268
``min_count`` non-NA values are present the result will be NA.
72707269
7271-
.. versionadded :: 0.21.2
7270+
.. versionadded :: 0.22.0
72727271
72737272
Added with the default being 1. This means the sum or product
72747273
of an all-NA or empty series is ``NaN``.

0 commit comments

Comments
 (0)