Skip to content

Commit

Permalink
DOC: fix PR07 and SA01 issue for Index: copy and get_slice_bound (#58443
Browse files Browse the repository at this point in the history
)

* DOC: fix PR07 and SA01 issue for Index: copy and get_slice_bound

* ficing line to long error
  • Loading branch information
KeiOshima committed Apr 26, 2024
1 parent 13771ab commit a1fc8e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Expand Up @@ -105,15 +105,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Grouper PR02" \
-i "pandas.Index PR07" \
-i "pandas.Index.append PR07,RT03,SA01" \
-i "pandas.Index.copy PR07,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" \
-i "pandas.Index.get_indexer_non_unique PR07,SA01" \
-i "pandas.Index.get_loc PR07,RT03,SA01" \
-i "pandas.Index.get_slice_bound PR07" \
-i "pandas.Index.identical PR01,SA01" \
-i "pandas.Index.insert PR07,RT03,SA01" \
-i "pandas.Index.intersection PR07,RT03,SA01" \
Expand Down
10 changes: 10 additions & 0 deletions pandas/core/indexes/base.py
Expand Up @@ -1262,12 +1262,19 @@ def copy(
name : Label, optional
Set name for new object.
deep : bool, default False
If True attempts to make a deep copy of the Index.
Else makes a shallow copy.
Returns
-------
Index
Index refer to new object which is a copy of this object.
See Also
--------
Index.delete: Make new Index with passed location(-s) deleted.
Index.drop: Make new Index with passed list of labels deleted.
Notes
-----
In most cases, there should be no functional difference from using
Expand Down Expand Up @@ -6398,7 +6405,10 @@ def get_slice_bound(self, label, side: Literal["left", "right"]) -> int:
Parameters
----------
label : object
The label for which to calculate the slice bound.
side : {'left', 'right'}
if 'left' return leftmost position of given label.
if 'right' return one-past-the-rightmost position of given label.
Returns
-------
Expand Down

0 comments on commit a1fc8e8

Please sign in to comment.