Skip to content

Commit 19ed357

Browse files
phoflJulianWgs
authored andcommitted
Fix deprecation warnings for empty series in docstrings (pandas-dev#41463)
1 parent 0e42280 commit 19ed357

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/core/generic.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -11359,7 +11359,7 @@ def _doc_params(cls):
1135911359
True
1136011360
>>> pd.Series([True, False]).all()
1136111361
False
11362-
>>> pd.Series([]).all()
11362+
>>> pd.Series([], dtype="float64").all()
1136311363
True
1136411364
>>> pd.Series([np.nan]).all()
1136511365
True
@@ -11727,7 +11727,7 @@ def _doc_params(cls):
1172711727
False
1172811728
>>> pd.Series([True, False]).any()
1172911729
True
11730-
>>> pd.Series([]).any()
11730+
>>> pd.Series([], dtype="float64").any()
1173111731
False
1173211732
>>> pd.Series([np.nan]).any()
1173311733
False
@@ -11815,13 +11815,13 @@ def _doc_params(cls):
1181511815
1181611816
By default, the sum of an empty or all-NA Series is ``0``.
1181711817
11818-
>>> pd.Series([]).sum() # min_count=0 is the default
11818+
>>> pd.Series([], dtype="float64").sum() # min_count=0 is the default
1181911819
0.0
1182011820
1182111821
This can be controlled with the ``min_count`` parameter. For example, if
1182211822
you'd like the sum of an empty series to be NaN, pass ``min_count=1``.
1182311823
11824-
>>> pd.Series([]).sum(min_count=1)
11824+
>>> pd.Series([], dtype="float64").sum(min_count=1)
1182511825
nan
1182611826
1182711827
Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and
@@ -11862,12 +11862,12 @@ def _doc_params(cls):
1186211862
--------
1186311863
By default, the product of an empty or all-NA Series is ``1``
1186411864
11865-
>>> pd.Series([]).prod()
11865+
>>> pd.Series([], dtype="float64").prod()
1186611866
1.0
1186711867
1186811868
This can be controlled with the ``min_count`` parameter
1186911869
11870-
>>> pd.Series([]).prod(min_count=1)
11870+
>>> pd.Series([], dtype="float64").prod(min_count=1)
1187111871
nan
1187211872
1187311873
Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and

0 commit comments

Comments
 (0)