Skip to content

Commit 6766803

Browse files
committed
DOC: added parameters to reindex function docstrigs
1 parent 9ab55b4 commit 6766803

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

pandas/core/indexes/base.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3763,11 +3763,31 @@ def _validate_can_reindex(self, indexer: np.ndarray) -> None:
37633763

37643764
def reindex(self, target, method=None, level=None, limit=None, tolerance=None):
37653765
"""
3766-
Create index with target's values.
3766+
Create an index with target's values.
37673767
37683768
Parameters
37693769
----------
37703770
target : an iterable
3771+
method : {None, ‘backfill’/’bfill’, ‘pad’/’ffill’, ‘nearest’}
3772+
Method to use for filling holes in reindexed DataFrame.
3773+
Please note: this is only applicable to DataFrames/Series
3774+
with a monotonically increasing/decreasing index.
3775+
- None (default): don’t fill gaps
3776+
- pad / ffill: Propagate last valid observation forward to next valid.
3777+
- backfill / bfill: Use next valid observation to fill gap.
3778+
- nearest: Use nearest valid observations to fill gap.
3779+
level : int or name
3780+
Broadcast across a level, matching Index values on the passed MultiIndex level.
3781+
limit : int, default None
3782+
Maximum number of consecutive elements to forward or backward fill.
3783+
tolerance : optional
3784+
Maximum distance between original and new labels for inexact matches.
3785+
The values of the index at the matching locations most satisfy the
3786+
equation `abs(index[indexer] - target) <= tolerance.
3787+
Tolerance may be a scalar value, which applies the same tolerance to all values,
3788+
or list-like, which applies variable tolerance per element.
3789+
List-like includes list, tuple, array, Series, and must be the same size
3790+
as the index and its dtype must exactly match the index’s type.
37713791
37723792
Returns
37733793
-------

0 commit comments

Comments
 (0)