Skip to content

Commit c08e71b

Browse files
committed
DOC: improve fillna() doc for limit keyword (fixes #10002)
1 parent 845cec9 commit c08e71b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

pandas/core/categorical.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,9 @@ def fillna(self, fill_value=None, method=None, limit=None):
11801180
value : scalar
11811181
Value to use to fill holes (e.g. 0)
11821182
limit : int, default None
1183-
Maximum size gap to forward or backward fill (not implemented yet!)
1183+
If method is specified, this is the maximum size gap to forward or backward
1184+
fill. Otherwise this is the maximum number of entries along the axis where
1185+
holes will be filled. (not implemented yet!)
11841186
11851187
Returns
11861188
-------

pandas/core/generic.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,9 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,
23192319
other views on this object, (e.g. a no-copy slice for a column in a
23202320
DataFrame).
23212321
limit : int, default None
2322-
Maximum size gap to forward or backward fill
2322+
If method is specified, this is the maximum size gap to forward or backward
2323+
fill. Otherwise this is the maximum number of entries along the axis where
2324+
holes will be filled.
23232325
downcast : dict, default is None
23242326
a dict of item->dtype of what to downcast if possible,
23252327
or the string 'infer' which will try to downcast to an appropriate

pandas/core/internals.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def fillna(self, value, limit=None, inplace=False, downcast=None):
296296
if self.ndim > 2:
297297
raise NotImplementedError("number of dimensions for 'fillna' "
298298
"is currently limited to 2")
299-
mask[mask.cumsum(self.ndim-1)>limit]=False
299+
mask[mask.cumsum(self.ndim-1) > limit] = False
300300

301301
value = self._try_fill(value)
302302
blocks = self.putmask(mask, value, inplace=inplace)

0 commit comments

Comments
 (0)