Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors for Index.drop, Index.reindex #58454

Merged
merged 1 commit into from Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -6686,6 +6687,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 @@ -6699,6 +6702,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