Skip to content

Commit 0f2ed96

Browse files
committed
update
1 parent 303c5dc commit 0f2ed96

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

doc/source/missing_data.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Sum/Prod of Empties/Nans
192192
This behavior is now standard as of v0.21.0; previously sum/prod would give different
193193
results if the ``bottleneck`` package was installed. See the :ref:`here <whatsnew_0210.api_breaking.bottleneck>`.
194194

195-
If summing a ``DataFrame``, a ``Series`` of all-``NaN``.
195+
With ``sum`` or ``prod`` on an empty or all-``NaN`` ``Series``, or columns of a ``DataFrame``, the result will be all-``NaN``.
196196

197197
.. ipython:: python
198198
@@ -208,7 +208,7 @@ Summing of an empty ``Series``
208208
209209
.. warning::
210210

211-
These behaviors differ from the default in ``numpy`` which does not generally propagate NaNs
211+
These behaviors differ from the default in ``numpy`` where an empty sum returns zero.
212212

213213
.. ipython:: python
214214

doc/source/whatsnew/v0.21.0.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,7 @@ Sum/Prod of all-NaN Series/DataFrames is now consistently NaN
421421
The behavior of ``sum`` and ``prod`` on all-NaN Series/DataFrames is now consistent and no longer depends on
422422
whether `bottleneck <http://berkeleyanalytics.com/bottleneck>`__ is installed. (:issue:`9422`, :issue:`15507`).
423423

424-
This now will *always* preserve information. You will get back a ``NaN``, indicating missing values in that Series,
425-
or if summing a ``DataFrame``, a ``Series`` of all-``NaN``. See the :ref:`docs <missing_data.numeric_sum>`.
426-
424+
With ``sum`` or ``prod`` on an empty or all-``NaN`` ``Series``, or columns of a ``DataFrame``, the result will be all-``NaN``. See the :ref:`docs <missing_data.numeric_sum>`.
427425

428426
.. ipython:: python
429427

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6990,7 +6990,7 @@ def _doc_parms(cls):
69906990
----------
69916991
axis : %(axis_descr)s
69926992
skipna : boolean, default True
6993-
Exclude NA/null values. If an entire row/column is NA, the result
6993+
Exclude NA/null values. If an entire row/column is NA or empty, the result
69946994
will be NA
69956995
level : int or level name, default None
69966996
If the axis is a MultiIndex (hierarchical), count along a

0 commit comments

Comments
 (0)