9090
9191Parameters
9292----------
93- {extra_args}
94- skipna : bool, optional
95- If True, skip missing values (as marked by NaN). By default, only
96- skips missing values for float dtypes; other dtypes either do not
97- have a sentinel missing value (int) or skipna=True has not been
98- implemented (object, datetime64 or timedelta64).{min_count_docs}
93+ {extra_args}{skip_na_docs}{min_count_docs}
9994keep_attrs : bool, optional
10095 If True, the attributes (`attrs`) will be copied from the original
10196 object to the new one. If False (default), the new object will be
111106 indicated dimension(s) removed.
112107"""
113108
109+ _SKIPNA_DOCSTRING = """
110+ skipna : bool, optional
111+ If True, skip missing values (as marked by NaN). By default, only
112+ skips missing values for float dtypes; other dtypes either do not
113+ have a sentinel missing value (int) or skipna=True has not been
114+ implemented (object, datetime64 or timedelta64)."""
115+
114116_MINCOUNT_DOCSTRING = """
115117min_count : int, default None
116118 The required number of valid values to perform the operation.
@@ -260,6 +262,7 @@ def inject_reduce_methods(cls):
260262 for name , f , include_skipna in methods :
261263 numeric_only = getattr (f , "numeric_only" , False )
262264 available_min_count = getattr (f , "available_min_count" , False )
265+ skip_na_docs = _SKIPNA_DOCSTRING if include_skipna else ""
263266 min_count_docs = _MINCOUNT_DOCSTRING if available_min_count else ""
264267
265268 func = cls ._reduce_method (f , include_skipna , numeric_only )
@@ -268,6 +271,7 @@ def inject_reduce_methods(cls):
268271 name = name ,
269272 cls = cls .__name__ ,
270273 extra_args = cls ._reduce_extra_args_docstring .format (name = name ),
274+ skip_na_docs = skip_na_docs ,
271275 min_count_docs = min_count_docs ,
272276 )
273277 setattr (cls , name , func )
0 commit comments