@@ -2195,7 +2195,7 @@ def _reduce(self, name, axis=0, **kwargs):
21952195 return func (** kwargs )
21962196
21972197 @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 ):
21992199 """
22002200 The minimum value of the object.
22012201
@@ -2212,17 +2212,20 @@ def min(self, skipna=True, **kwargs):
22122212 """
22132213 self .check_for_ordered ("min" )
22142214 good = self ._codes != - 1
2215- if good .any ():
2215+ if not good .all ():
22162216 if skipna :
22172217 pointer = self ._codes [good ].min (** kwargs )
22182218 else :
2219+ msg = ("The default value of skipna will be changed to "
2220+ "True in the future version." )
2221+ warn (msg , FutureWarning , stacklevel = 2 )
22192222 return np .nan
22202223 else :
22212224 pointer = self ._codes .min (** kwargs )
22222225 return self .categories [pointer ]
22232226
22242227 @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 ):
22262229 """
22272230 The maximum value of the object.
22282231
@@ -2239,10 +2242,13 @@ def max(self, skipna=True, **kwargs):
22392242 """
22402243 self .check_for_ordered ("max" )
22412244 good = self ._codes != - 1
2242- if good .any ():
2245+ if not good .all ():
22432246 if skipna :
22442247 pointer = self ._codes [good ].max (** kwargs )
22452248 else :
2249+ msg = ("The default value of skipna will be changed to "
2250+ "True in the future version." )
2251+ warn (msg , FutureWarning , stacklevel = 2 )
22462252 return np .nan
22472253 else :
22482254 pointer = self ._codes .max (** kwargs )
0 commit comments