From e794114c971db6122b0446721b54a88b96982ca9 Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Sat, 20 Apr 2024 16:32:55 -0400 Subject: [PATCH 1/6] Shorten sentence length --- ci/code_checks.sh | 3 --- pandas/core/base.py | 5 +++++ pandas/core/indexes/base.py | 12 ++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index cabc25b5e0ba5..2c70d860d559c 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -156,18 +156,15 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -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.hasnans SA01" \ -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.item SA01" \ -i "pandas.Index.join PR07,RT03,SA01" \ - -i "pandas.Index.map SA01" \ -i "pandas.Index.memory_usage RT03" \ -i "pandas.Index.name SA01" \ -i "pandas.Index.names GL08" \ - -i "pandas.Index.nbytes SA01" \ -i "pandas.Index.nunique RT03" \ -i "pandas.Index.putmask PR01,RT03" \ -i "pandas.Index.ravel PR01,RT03" \ diff --git a/pandas/core/base.py b/pandas/core/base.py index 9b1251a4ef5d8..424f0609dd485 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -419,6 +419,11 @@ def nbytes(self) -> int: """ Return the number of bytes in the underlying data. + See Also + -------- + Series.ndim : Number of dimensions of the underlying data. + Series.size : Return the number of elements in the underlying data. + Examples -------- For Series: diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 8ede401f37184..db252b8c72c2a 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2423,6 +2423,13 @@ def hasnans(self) -> bool: ------- bool + See Also + -------- + Series.isna : Return a boolean same-sized object indicating if the values + are NA. + Series.dropna : Return a new Series with missing values removed. + Series.fillna : Fill NA/NaN values using the specified method. + Examples -------- >>> s = pd.Series([1, 2, 3], index=["a", "b", None]) @@ -6067,6 +6074,11 @@ def map(self, mapper, na_action: Literal["ignore"] | None = None): If the function returns a tuple with more than one element a MultiIndex will be returned. + See Also + -------- + Series.apply : Invoke function on values of Series. + Series.replace : Replace values given in to_replace with value. + Examples -------- >>> idx = pd.Index([1, 2, 3]) From 26c0cdd19f36ebaef95f50f92fff2655960be8e1 Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Sat, 20 Apr 2024 18:21:08 -0400 Subject: [PATCH 2/6] Remove Series.nbytes from ci/code_checks.sh --- ci/code_checks.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 2c70d860d559c..4debc2eb91449 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -341,7 +341,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.mod PR07" \ -i "pandas.Series.mode SA01" \ -i "pandas.Series.mul PR07" \ - -i "pandas.Series.nbytes SA01" \ -i "pandas.Series.ne PR07,SA01" \ -i "pandas.Series.nunique RT03" \ -i "pandas.Series.pad PR01,SA01" \ From 2477dc3c100f7cc0571666361d71b9f449575fba Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Sun, 21 Apr 2024 13:59:51 -0400 Subject: [PATCH 3/6] Update see also method names --- 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 db252b8c72c2a..791ab9f72310d 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2425,10 +2425,10 @@ def hasnans(self) -> bool: See Also -------- - Series.isna : Return a boolean same-sized object indicating if the values + Index.isna : Return a boolean same-sized object indicating if the values are NA. - Series.dropna : Return a new Series with missing values removed. - Series.fillna : Fill NA/NaN values using the specified method. + Index.dropna : Return a new Series with missing values removed. + Index.fillna : Fill NA/NaN values using the specified method. Examples -------- From 29bc51902172e07c77a2f72aa0c8af50b87cd334 Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Sun, 21 Apr 2024 14:01:05 -0400 Subject: [PATCH 4/6] Update see also method names --- 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 791ab9f72310d..fd8bd4e577c35 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -6076,8 +6076,8 @@ def map(self, mapper, na_action: Literal["ignore"] | None = None): See Also -------- - Series.apply : Invoke function on values of Series. - Series.replace : Replace values given in to_replace with value. + Index.apply : Invoke function on values of Series. + Index.replace : Replace values given in to_replace with value. Examples -------- From 86b52c401155a393a64eefef19d9acb92e2405c3 Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Sun, 21 Apr 2024 14:55:48 -0400 Subject: [PATCH 5/6] Update see also methods for Index.map --- pandas/core/indexes/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index fd8bd4e577c35..4712a5e371afe 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -6076,8 +6076,7 @@ def map(self, mapper, na_action: Literal["ignore"] | None = None): See Also -------- - Index.apply : Invoke function on values of Series. - Index.replace : Replace values given in to_replace with value. + Index.where : Replace values where the condition is False. Examples -------- From 2aafeac93ff6003d0e6033e2f9a628e035844bb7 Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Sun, 21 Apr 2024 15:00:22 -0400 Subject: [PATCH 6/6] Update method descriptions --- pandas/core/indexes/base.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 4712a5e371afe..d1d1c5ea3171f 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2425,10 +2425,9 @@ def hasnans(self) -> bool: See Also -------- - Index.isna : Return a boolean same-sized object indicating if the values - are NA. - Index.dropna : Return a new Series with missing values removed. - Index.fillna : Fill NA/NaN values using the specified method. + Index.isna : Detect missing values. + Index.dropna : Return Index without NA/NaN values. + Index.fillna : Fill NA/NaN values with the specified value. Examples --------