diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 9aae477ca1af3..fbdda3efa58e8 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -107,7 +107,6 @@ 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.droplevel RT03,SA01" \ @@ -117,7 +116,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -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.inferred_type SA01" \ -i "pandas.Index.insert PR07,RT03,SA01" \ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index ace082fba609a..175782c892e40 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -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 @@ -6382,7 +6389,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 -------