@@ -2049,7 +2049,7 @@ def hfunc(bvalues: ArrayLike) -> ArrayLike:
2049
2049
@Substitution (see_also = _common_see_also )
2050
2050
def mean (
2051
2051
self ,
2052
- numeric_only : bool | lib . NoDefault = lib . no_default ,
2052
+ numeric_only : bool = False ,
2053
2053
engine : str = "cython" ,
2054
2054
engine_kwargs : dict [str , bool ] | None = None ,
2055
2055
):
@@ -2058,12 +2058,12 @@ def mean(
2058
2058
2059
2059
Parameters
2060
2060
----------
2061
- numeric_only : bool, default True
2061
+ numeric_only : bool, default False
2062
2062
Include only float, int, boolean columns.
2063
2063
2064
2064
.. versionchanged:: 2.0.0
2065
2065
2066
- numeric_only no longer accepts ``None``.
2066
+ numeric_only no longer accepts ``None`` and defaults to ``False`` .
2067
2067
2068
2068
engine : str, default None
2069
2069
* ``'cython'`` : Runs the operation through C-extensions from cython.
@@ -2120,7 +2120,6 @@ def mean(
2120
2120
2 4.0
2121
2121
Name: B, dtype: float64
2122
2122
"""
2123
- numeric_only_bool = self ._resolve_numeric_only ("mean" , numeric_only , axis = 0 )
2124
2123
2125
2124
if maybe_use_numba (engine ):
2126
2125
from pandas .core ._numba .kernels import sliding_mean
@@ -2129,7 +2128,7 @@ def mean(
2129
2128
else :
2130
2129
result = self ._cython_agg_general (
2131
2130
"mean" ,
2132
- alt = lambda x : Series (x ).mean (numeric_only = numeric_only_bool ),
2131
+ alt = lambda x : Series (x ).mean (numeric_only = numeric_only ),
2133
2132
numeric_only = numeric_only ,
2134
2133
)
2135
2134
return result .__finalize__ (self .obj , method = "groupby" )
@@ -2382,10 +2381,10 @@ def size(self) -> DataFrame | Series:
2382
2381
return self ._reindex_output (result , fill_value = 0 )
2383
2382
2384
2383
@final
2385
- @doc (_groupby_agg_method_template , fname = "sum" , no = True , mc = 0 )
2384
+ @doc (_groupby_agg_method_template , fname = "sum" , no = False , mc = 0 )
2386
2385
def sum (
2387
2386
self ,
2388
- numeric_only : bool | lib . NoDefault = lib . no_default ,
2387
+ numeric_only : bool = False ,
2389
2388
min_count : int = 0 ,
2390
2389
engine : str | None = None ,
2391
2390
engine_kwargs : dict [str , bool ] | None = None ,
0 commit comments