Skip to content

Commit 1593fb9

Browse files
Fix errors for Index.drop, Index.reindex (#58454)
1 parent bd84be4 commit 1593fb9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: ci/code_checks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
106106
-i "pandas.Index PR07" \
107107
-i "pandas.Index.append PR07,RT03,SA01" \
108108
-i "pandas.Index.difference PR07,RT03,SA01" \
109-
-i "pandas.Index.drop PR07,SA01" \
110109
-i "pandas.Index.duplicated RT03" \
111110
-i "pandas.Index.get_indexer PR07,SA01" \
112111
-i "pandas.Index.get_indexer_for PR01,SA01" \
@@ -120,7 +119,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
120119
-i "pandas.Index.nunique RT03" \
121120
-i "pandas.Index.putmask PR01,RT03" \
122121
-i "pandas.Index.ravel PR01,RT03" \
123-
-i "pandas.Index.reindex PR07" \
124122
-i "pandas.Index.slice_indexer PR07,RT03,SA01" \
125123
-i "pandas.Index.str PR01,SA01" \
126124
-i "pandas.Index.symmetric_difference PR07,RT03,SA01" \

Diff for: pandas/core/indexes/base.py

+8
Original file line numberDiff line numberDiff line change
@@ -3953,6 +3953,7 @@ def reindex(
39533953
Parameters
39543954
----------
39553955
target : an iterable
3956+
An iterable containing the values to be used for creating the new index.
39563957
method : {None, 'pad'/'ffill', 'backfill'/'bfill', 'nearest'}, optional
39573958
* default: exact matches only.
39583959
* pad / ffill: find the PREVIOUS index value if no exact match.
@@ -6686,6 +6687,8 @@ def drop(
66866687
Parameters
66876688
----------
66886689
labels : array-like or scalar
6690+
Array-like object or a scalar value, representing the labels to be removed
6691+
from the Index.
66896692
errors : {'ignore', 'raise'}, default 'raise'
66906693
If 'ignore', suppress error and existing labels are dropped.
66916694
@@ -6699,6 +6702,11 @@ def drop(
66996702
KeyError
67006703
If not all of the labels are found in the selected axis
67016704
6705+
See Also
6706+
--------
6707+
Index.dropna : Return Index without NA/NaN values.
6708+
Index.drop_duplicates : Return Index with duplicate values removed.
6709+
67026710
Examples
67036711
--------
67046712
>>> idx = pd.Index(["a", "b", "c"])

0 commit comments

Comments
 (0)