Skip to content

Commit 82449b9

Browse files
DOC: fix EX03 errors in docstrings - pandas.Index.rename, pandas.Index.isin, pandas.IndexSlice (#56870)
Co-authored-by: Marc Garcia <garcia.marc@gmail.com>
1 parent cc0ae35 commit 82449b9

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8989
pandas.DataFrame.to_sql \
9090
pandas.read_stata \
9191
pandas.plotting.scatter_matrix \
92-
pandas.Index.rename \
9392
pandas.Index.droplevel \
94-
pandas.Index.isin \
9593
pandas.MultiIndex.names \
9694
pandas.MultiIndex.droplevel \
97-
pandas.IndexSlice \
9895
pandas.Grouper \
9996
pandas.io.formats.style.Styler.map \
10097
pandas.io.formats.style.Styler.apply_index \

pandas/core/indexes/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,7 @@ def rename(self, name, inplace: bool = False) -> Self | None:
19531953
19541954
>>> idx = pd.MultiIndex.from_product([['python', 'cobra'],
19551955
... [2018, 2019]],
1956-
... names=['kind', 'year'])
1956+
... names=['kind', 'year'])
19571957
>>> idx
19581958
MultiIndex([('python', 2018),
19591959
('python', 2019),
@@ -6575,7 +6575,7 @@ def isin(self, values, level=None) -> npt.NDArray[np.bool_]:
65756575
65766576
Examples
65776577
--------
6578-
>>> idx = pd.Index([1,2,3])
6578+
>>> idx = pd.Index([1, 2, 3])
65796579
>>> idx
65806580
Index([1, 2, 3], dtype='int64')
65816581
@@ -6584,7 +6584,7 @@ def isin(self, values, level=None) -> npt.NDArray[np.bool_]:
65846584
>>> idx.isin([1, 4])
65856585
array([ True, False, False])
65866586
6587-
>>> midx = pd.MultiIndex.from_arrays([[1,2,3],
6587+
>>> midx = pd.MultiIndex.from_arrays([[1, 2, 3],
65886588
... ['red', 'blue', 'green']],
65896589
... names=('number', 'color'))
65906590
>>> midx

pandas/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class _IndexSlice:
121121
122122
Examples
123123
--------
124-
>>> midx = pd.MultiIndex.from_product([['A0','A1'], ['B0','B1','B2','B3']])
124+
>>> midx = pd.MultiIndex.from_product([['A0', 'A1'], ['B0', 'B1', 'B2', 'B3']])
125125
>>> columns = ['foo', 'bar']
126126
>>> dfmi = pd.DataFrame(np.arange(16).reshape((len(midx), len(columns))),
127127
... index=midx, columns=columns)

0 commit comments

Comments
 (0)