Skip to content

Commit

Permalink
Fix errors for Index.drop, Index.reindex (pandas-dev#58454)
Browse files Browse the repository at this point in the history
  • Loading branch information
shriyakalakata authored and pmhatre1 committed May 7, 2024
1 parent 5fb73e2 commit 3c24787
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Expand Up @@ -106,7 +106,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Index PR07" \
-i "pandas.Index.append PR07,RT03,SA01" \
-i "pandas.Index.difference PR07,RT03,SA01" \
-i "pandas.Index.drop PR07,SA01" \
-i "pandas.Index.duplicated RT03" \
-i "pandas.Index.get_indexer PR07,SA01" \
-i "pandas.Index.get_indexer_for PR01,SA01" \
Expand All @@ -120,7 +119,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Index.nunique RT03" \
-i "pandas.Index.putmask PR01,RT03" \
-i "pandas.Index.ravel PR01,RT03" \
-i "pandas.Index.reindex PR07" \
-i "pandas.Index.slice_indexer PR07,RT03,SA01" \
-i "pandas.Index.str PR01,SA01" \
-i "pandas.Index.symmetric_difference PR07,RT03,SA01" \
Expand Down
8 changes: 8 additions & 0 deletions pandas/core/indexes/base.py
Expand Up @@ -3953,6 +3953,7 @@ def reindex(
Parameters
----------
target : an iterable
An iterable containing the values to be used for creating the new index.
method : {None, 'pad'/'ffill', 'backfill'/'bfill', 'nearest'}, optional
* default: exact matches only.
* pad / ffill: find the PREVIOUS index value if no exact match.
Expand Down Expand Up @@ -6667,6 +6668,8 @@ def drop(
Parameters
----------
labels : array-like or scalar
Array-like object or a scalar value, representing the labels to be removed
from the Index.
errors : {'ignore', 'raise'}, default 'raise'
If 'ignore', suppress error and existing labels are dropped.
Expand All @@ -6680,6 +6683,11 @@ def drop(
KeyError
If not all of the labels are found in the selected axis
See Also
--------
Index.dropna : Return Index without NA/NaN values.
Index.drop_duplicates : Return Index with duplicate values removed.
Examples
--------
>>> idx = pd.Index(["a", "b", "c"])
Expand Down

0 comments on commit 3c24787

Please sign in to comment.