Skip to content

Commit

Permalink
DOC: fix EX03 errors in docstrings - pandas.Index.rename, pandas.Inde…
Browse files Browse the repository at this point in the history
…x.isin, pandas.IndexSlice (pandas-dev#56870)

Co-authored-by: Marc Garcia <[email protected]>
  • Loading branch information
2 people authored and pmhatre1 committed May 7, 2024
1 parent 9131862 commit b77fd59
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.DataFrame.to_sql \
pandas.read_stata \
pandas.plotting.scatter_matrix \
pandas.Index.rename \
pandas.Index.droplevel \
pandas.Index.isin \
pandas.MultiIndex.names \
pandas.MultiIndex.droplevel \
pandas.IndexSlice \
pandas.Grouper \
pandas.io.formats.style.Styler.map \
pandas.io.formats.style.Styler.apply_index \
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,7 @@ def rename(self, name, inplace: bool = False) -> Self | None:
>>> idx = pd.MultiIndex.from_product([['python', 'cobra'],
... [2018, 2019]],
... names=['kind', 'year'])
... names=['kind', 'year'])
>>> idx
MultiIndex([('python', 2018),
('python', 2019),
Expand Down Expand Up @@ -6575,7 +6575,7 @@ def isin(self, values, level=None) -> npt.NDArray[np.bool_]:
Examples
--------
>>> idx = pd.Index([1,2,3])
>>> idx = pd.Index([1, 2, 3])
>>> idx
Index([1, 2, 3], dtype='int64')
Expand All @@ -6584,7 +6584,7 @@ def isin(self, values, level=None) -> npt.NDArray[np.bool_]:
>>> idx.isin([1, 4])
array([ True, False, False])
>>> midx = pd.MultiIndex.from_arrays([[1,2,3],
>>> midx = pd.MultiIndex.from_arrays([[1, 2, 3],
... ['red', 'blue', 'green']],
... names=('number', 'color'))
>>> midx
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class _IndexSlice:
Examples
--------
>>> midx = pd.MultiIndex.from_product([['A0','A1'], ['B0','B1','B2','B3']])
>>> midx = pd.MultiIndex.from_product([['A0', 'A1'], ['B0', 'B1', 'B2', 'B3']])
>>> columns = ['foo', 'bar']
>>> dfmi = pd.DataFrame(np.arange(16).reshape((len(midx), len(columns))),
... index=midx, columns=columns)
Expand Down

0 comments on commit b77fd59

Please sign in to comment.