From 310545d2c8eccad89f87ca2ffebef93ab9685112 Mon Sep 17 00:00:00 2001 From: shriyakalakata <87483933+shriyakalakata@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:54:25 -0400 Subject: [PATCH] DOC: Fix Index.inferred type SA01 and Index.slice_locs RT03 errors (#58435) Fix Index.inferred type SA01 and Index.slice_locs RT03 errors --- ci/code_checks.sh | 2 -- pandas/core/indexes/base.py | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 2ae74cfbe6e2e..f7eb16b4a85b5 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -118,7 +118,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -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" \ -i "pandas.Index.intersection PR07,RT03,SA01" \ -i "pandas.Index.join PR07,RT03,SA01" \ @@ -128,7 +127,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Index.ravel PR01,RT03" \ -i "pandas.Index.reindex PR07" \ -i "pandas.Index.slice_indexer PR07,RT03,SA01" \ - -i "pandas.Index.slice_locs RT03" \ -i "pandas.Index.str PR01,SA01" \ -i "pandas.Index.symmetric_difference PR07,RT03,SA01" \ -i "pandas.Index.take PR01,PR07" \ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 59deca5455288..e878a6d3a7421 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2360,6 +2360,10 @@ def inferred_type(self) -> str_t: """ Return a string of the type inferred from the values. + See Also + -------- + Index.dtype : Return the dtype object of the underlying data. + Examples -------- >>> idx = pd.Index([1, 2, 3]) @@ -6452,6 +6456,8 @@ def slice_locs(self, start=None, end=None, step=None) -> tuple[int, int]: Returns ------- tuple[int, int] + Returns a tuple of two integers representing the slice locations for the + input labels within the index. See Also --------