@@ -3239,7 +3239,7 @@ def convert_objects(self, convert_dates=True, convert_numeric=False,
32393239 a gap with more than this number of consecutive NaNs, it will only
32403240 be partially filled. If method is not specified, this is the
32413241 maximum number of entries along the entire axis where NaNs will be
3242- filled.
3242+ filled. Must be greater than 0 if not None.
32433243 downcast : dict, default is None
32443244 a dict of item->dtype of what to downcast if possible,
32453245 or the string 'infer' which will try to downcast to an appropriate
@@ -3257,6 +3257,9 @@ def convert_objects(self, convert_dates=True, convert_numeric=False,
32573257 @Appender (_shared_docs ['fillna' ] % _shared_doc_kwargs )
32583258 def fillna (self , value = None , method = None , axis = None , inplace = False ,
32593259 limit = None , downcast = None ):
3260+ if is_integer (limit ) and not limit > 0 :
3261+ raise ValueError ('`limit` keyword argument must be greater '
3262+ 'than 0.' )
32603263 if isinstance (value , (list , tuple )):
32613264 raise TypeError ('"value" parameter must be a scalar or dict, but '
32623265 'you passed a "{0}"' .format (type (value ).__name__ ))
@@ -3662,7 +3665,7 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
36623665 * 0: fill column-by-column
36633666 * 1: fill row-by-row
36643667 limit : int, default None.
3665- Maximum number of consecutive NaNs to fill.
3668+ Maximum number of consecutive NaNs to fill. Must be greater than 0.
36663669 limit_direction : {'forward', 'backward', 'both'}, default 'forward'
36673670 If limit is specified, consecutive NaNs will be filled in this
36683671 direction.
@@ -3704,6 +3707,9 @@ def interpolate(self, method='linear', axis=0, limit=None, inplace=False,
37043707 """
37053708 Interpolate values according to different methods.
37063709 """
3710+ if is_integer (limit ) and not limit > 0 :
3711+ raise ValueError ("`limit` keyword argument must be greater "
3712+ "than 0." )
37073713
37083714 if self .ndim > 2 :
37093715 raise NotImplementedError ("Interpolate has not been implemented "
0 commit comments