Skip to content

Commit a1fc8e8

Browse files
authored
DOC: fix PR07 and SA01 issue for Index: copy and get_slice_bound (#58443)
* DOC: fix PR07 and SA01 issue for Index: copy and get_slice_bound * ficing line to long error
1 parent 13771ab commit a1fc8e8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Diff for: ci/code_checks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
105105
-i "pandas.Grouper PR02" \
106106
-i "pandas.Index PR07" \
107107
-i "pandas.Index.append PR07,RT03,SA01" \
108-
-i "pandas.Index.copy PR07,SA01" \
109108
-i "pandas.Index.difference PR07,RT03,SA01" \
110109
-i "pandas.Index.drop PR07,SA01" \
111110
-i "pandas.Index.duplicated RT03" \
112111
-i "pandas.Index.get_indexer PR07,SA01" \
113112
-i "pandas.Index.get_indexer_for PR01,SA01" \
114113
-i "pandas.Index.get_indexer_non_unique PR07,SA01" \
115114
-i "pandas.Index.get_loc PR07,RT03,SA01" \
116-
-i "pandas.Index.get_slice_bound PR07" \
117115
-i "pandas.Index.identical PR01,SA01" \
118116
-i "pandas.Index.insert PR07,RT03,SA01" \
119117
-i "pandas.Index.intersection PR07,RT03,SA01" \

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

+10
Original file line numberDiff line numberDiff line change
@@ -1262,12 +1262,19 @@ def copy(
12621262
name : Label, optional
12631263
Set name for new object.
12641264
deep : bool, default False
1265+
If True attempts to make a deep copy of the Index.
1266+
Else makes a shallow copy.
12651267
12661268
Returns
12671269
-------
12681270
Index
12691271
Index refer to new object which is a copy of this object.
12701272
1273+
See Also
1274+
--------
1275+
Index.delete: Make new Index with passed location(-s) deleted.
1276+
Index.drop: Make new Index with passed list of labels deleted.
1277+
12711278
Notes
12721279
-----
12731280
In most cases, there should be no functional difference from using
@@ -6398,7 +6405,10 @@ def get_slice_bound(self, label, side: Literal["left", "right"]) -> int:
63986405
Parameters
63996406
----------
64006407
label : object
6408+
The label for which to calculate the slice bound.
64016409
side : {'left', 'right'}
6410+
if 'left' return leftmost position of given label.
6411+
if 'right' return one-past-the-rightmost position of given label.
64026412
64036413
Returns
64046414
-------

0 commit comments

Comments
 (0)