@@ -3239,7 +3239,7 @@ def convert_objects(self, convert_dates=True, convert_numeric=False,
3239
3239
a gap with more than this number of consecutive NaNs, it will only
3240
3240
be partially filled. If method is not specified, this is the
3241
3241
maximum number of entries along the entire axis where NaNs will be
3242
- filled.
3242
+ filled. Must be greater than 0 if not None.
3243
3243
downcast : dict, default is None
3244
3244
a dict of item->dtype of what to downcast if possible,
3245
3245
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,
3257
3257
@Appender (_shared_docs ['fillna' ] % _shared_doc_kwargs )
3258
3258
def fillna (self , value = None , method = None , axis = None , inplace = False ,
3259
3259
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.' )
3260
3263
if isinstance (value , (list , tuple )):
3261
3264
raise TypeError ('"value" parameter must be a scalar or dict, but '
3262
3265
'you passed a "{0}"' .format (type (value ).__name__ ))
@@ -3662,7 +3665,7 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3662
3665
* 0: fill column-by-column
3663
3666
* 1: fill row-by-row
3664
3667
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.
3666
3669
limit_direction : {'forward', 'backward', 'both'}, default 'forward'
3667
3670
If limit is specified, consecutive NaNs will be filled in this
3668
3671
direction.
@@ -3704,6 +3707,9 @@ def interpolate(self, method='linear', axis=0, limit=None, inplace=False,
3704
3707
"""
3705
3708
Interpolate values according to different methods.
3706
3709
"""
3710
+ if is_integer (limit ) and not limit > 0 :
3711
+ raise ValueError ("`limit` keyword argument must be greater "
3712
+ "than 0." )
3707
3713
3708
3714
if self .ndim > 2 :
3709
3715
raise NotImplementedError ("Interpolate has not been implemented "
0 commit comments