Skip to content

Commit 2d78efc

Browse files
committed
Docstring for _fill method
1 parent 64c321c commit 2d78efc

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

pandas/core/groupby.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,27 @@ def expanding(self, *args, **kwargs):
14581458
return ExpandingGroupby(self, *args, **kwargs)
14591459

14601460
def _fill(self, direction, limit=None):
1461+
"""Shared function for `pad` and `backfill` to call Cython method
1462+
1463+
Parameters
1464+
----------
1465+
direction : {'ffill', 'bfill'}
1466+
Direction passed to underlying Cython function. `bfill` will cause
1467+
values to be filled backwards. `ffill` and any other values will
1468+
default to a forward fill
1469+
limit : int, default None
1470+
Maximum number of consecutive values to fill. If `None`, this
1471+
method will convert to -1 prior to passing to Cython
1472+
1473+
Returns
1474+
-------
1475+
`Series` or `DataFrame` with filled values
1476+
1477+
See Also
1478+
--------
1479+
pad
1480+
backfill
1481+
"""
14611482
# Need int value for Cython
14621483
if limit is None:
14631484
limit = -1
@@ -1869,7 +1890,7 @@ def _get_cythonized_result(self, how, grouper, needs_mask=False,
18691890
18701891
Returns
18711892
-------
1872-
GroupBy object populated with appropriate result(s)
1893+
`Series` or `DataFrame` with filled values
18731894
"""
18741895

18751896
labels, _, ngroups = grouper.group_info

0 commit comments

Comments
 (0)