From 51dd534e9caf342765f2b153a06b58dca5539438 Mon Sep 17 00:00:00 2001 From: nrezhang Date: Sun, 21 Apr 2024 12:30:28 -0400 Subject: [PATCH 1/3] pandas.Index.astype --- ci/code_checks.sh | 1 - pandas/core/indexes/base.py | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index d1cdff8f7f56b..57c47096f1bc8 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -143,7 +143,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Index PR07" \ -i "pandas.Index.T SA01" \ -i "pandas.Index.append PR07,RT03,SA01" \ - -i "pandas.Index.astype SA01" \ -i "pandas.Index.copy PR07,SA01" \ -i "pandas.Index.difference PR07,RT03,SA01" \ -i "pandas.Index.drop PR07,SA01" \ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 8ede401f37184..2aba9ee4d2b7b 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1056,6 +1056,12 @@ def astype(self, dtype, copy: bool = True): Index Index with values cast to specified dtype. + See Also + ------- + Series.dtype: Return the dtype object of the underlying data. + Series.dtypes: Return the dtype object of the underlying data. + Series.convert_dtypes: Convert columns to the best possible dtypes + Examples -------- >>> idx = pd.Index([1, 2, 3]) From ac29e6cef13333683a6c3779eb4961ea070e54c4 Mon Sep 17 00:00:00 2001 From: nrezhang Date: Sun, 21 Apr 2024 13:06:20 -0400 Subject: [PATCH 2/3] check fixes --- pandas/core/indexes/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 2aba9ee4d2b7b..6319a40bca394 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1057,10 +1057,10 @@ def astype(self, dtype, copy: bool = True): Index with values cast to specified dtype. See Also - ------- + -------- Series.dtype: Return the dtype object of the underlying data. Series.dtypes: Return the dtype object of the underlying data. - Series.convert_dtypes: Convert columns to the best possible dtypes + Series.convert_dtypes: Convert columns to the best possible dtypes. Examples -------- From 287f495e9649d78aaf8da9149bb54c4554fad86b Mon Sep 17 00:00:00 2001 From: nrezhang Date: Sun, 21 Apr 2024 14:05:30 -0400 Subject: [PATCH 3/3] series to index --- pandas/core/indexes/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 6319a40bca394..fb48aa5ba187c 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1058,9 +1058,9 @@ def astype(self, dtype, copy: bool = True): See Also -------- - Series.dtype: Return the dtype object of the underlying data. - Series.dtypes: Return the dtype object of the underlying data. - Series.convert_dtypes: Convert columns to the best possible dtypes. + Index.dtype: Return the dtype object of the underlying data. + Index.dtypes: Return the dtype object of the underlying data. + Index.convert_dtypes: Convert columns to the best possible dtypes. Examples --------