@@ -2195,7 +2195,7 @@ def _reduce(self, name, axis=0, **kwargs):
2195
2195
return func (** kwargs )
2196
2196
2197
2197
@deprecate_kwarg (old_arg_name = "numeric_only" , new_arg_name = "skipna" )
2198
- def min (self , skipna = True , ** kwargs ):
2198
+ def min (self , skipna = None , ** kwargs ):
2199
2199
"""
2200
2200
The minimum value of the object.
2201
2201
@@ -2212,17 +2212,20 @@ def min(self, skipna=True, **kwargs):
2212
2212
"""
2213
2213
self .check_for_ordered ("min" )
2214
2214
good = self ._codes != - 1
2215
- if good .any ():
2215
+ if not good .all ():
2216
2216
if skipna :
2217
2217
pointer = self ._codes [good ].min (** kwargs )
2218
2218
else :
2219
+ msg = ("The default value of skipna will be changed to "
2220
+ "True in the future version." )
2221
+ warn (msg , FutureWarning , stacklevel = 2 )
2219
2222
return np .nan
2220
2223
else :
2221
2224
pointer = self ._codes .min (** kwargs )
2222
2225
return self .categories [pointer ]
2223
2226
2224
2227
@deprecate_kwarg (old_arg_name = "numeric_only" , new_arg_name = "skipna" )
2225
- def max (self , skipna = True , ** kwargs ):
2228
+ def max (self , skipna = None , ** kwargs ):
2226
2229
"""
2227
2230
The maximum value of the object.
2228
2231
@@ -2239,10 +2242,13 @@ def max(self, skipna=True, **kwargs):
2239
2242
"""
2240
2243
self .check_for_ordered ("max" )
2241
2244
good = self ._codes != - 1
2242
- if good .any ():
2245
+ if not good .all ():
2243
2246
if skipna :
2244
2247
pointer = self ._codes [good ].max (** kwargs )
2245
2248
else :
2249
+ msg = ("The default value of skipna will be changed to "
2250
+ "True in the future version." )
2251
+ warn (msg , FutureWarning , stacklevel = 2 )
2246
2252
return np .nan
2247
2253
else :
2248
2254
pointer = self ._codes .max (** kwargs )
0 commit comments