Skip to content

Commit

Permalink
DOC: Fix SA01 errors for Index.hasnans, Index.map, Index.nbytes (pand…
Browse files Browse the repository at this point in the history
…as-dev#58343)

* Shorten sentence length

* Remove Series.nbytes from ci/code_checks.sh

* Update see also method names

* Update see also method names

* Update see also methods for Index.map

* Update method descriptions
  • Loading branch information
shriyakalakata authored and pmhatre1 committed May 7, 2024
1 parent 53421e8 commit fcc9f14
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down Expand Up @@ -344,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" \
Expand Down
5 changes: 5 additions & 0 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,12 @@ def hasnans(self) -> bool:
-------
bool
See Also
--------
Index.isna : Detect missing values.
Index.dropna : Return Index without NA/NaN values.
Index.fillna : Fill NA/NaN values with the specified value.
Examples
--------
>>> s = pd.Series([1, 2, 3], index=["a", "b", None])
Expand Down Expand Up @@ -6048,6 +6054,10 @@ 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
--------
Index.where : Replace values where the condition is False.
Examples
--------
>>> idx = pd.Index([1, 2, 3])
Expand Down

0 comments on commit fcc9f14

Please sign in to comment.