From 8bc0656db4bba9bab306b8b3a5b716b60f873350 Mon Sep 17 00:00:00 2001 From: phofl Date: Fri, 14 May 2021 00:34:46 +0200 Subject: [PATCH] Fix deprecation warnings for empty series in docstrings --- pandas/core/generic.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 0d39f13afc426..a09cc0a6324c0 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -11359,7 +11359,7 @@ def _doc_params(cls): True >>> pd.Series([True, False]).all() False ->>> pd.Series([]).all() +>>> pd.Series([], dtype="float64").all() True >>> pd.Series([np.nan]).all() True @@ -11727,7 +11727,7 @@ def _doc_params(cls): False >>> pd.Series([True, False]).any() True ->>> pd.Series([]).any() +>>> pd.Series([], dtype="float64").any() False >>> pd.Series([np.nan]).any() False @@ -11815,13 +11815,13 @@ def _doc_params(cls): By default, the sum of an empty or all-NA Series is ``0``. ->>> pd.Series([]).sum() # min_count=0 is the default +>>> pd.Series([], dtype="float64").sum() # min_count=0 is the default 0.0 This can be controlled with the ``min_count`` parameter. For example, if you'd like the sum of an empty series to be NaN, pass ``min_count=1``. ->>> pd.Series([]).sum(min_count=1) +>>> pd.Series([], dtype="float64").sum(min_count=1) nan Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and @@ -11862,12 +11862,12 @@ def _doc_params(cls): -------- By default, the product of an empty or all-NA Series is ``1`` ->>> pd.Series([]).prod() +>>> pd.Series([], dtype="float64").prod() 1.0 This can be controlled with the ``min_count`` parameter ->>> pd.Series([]).prod(min_count=1) +>>> pd.Series([], dtype="float64").prod(min_count=1) nan Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and