diff --git a/ci/code_checks.sh b/ci/code_checks.sh index efe2a3b36619d..cec29f8df29d5 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -174,13 +174,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Index.name SA01" \ -i "pandas.Index.names GL08" \ -i "pandas.Index.nbytes SA01" \ - -i "pandas.Index.ndim SA01" \ -i "pandas.Index.nunique RT03" \ -i "pandas.Index.putmask PR01,RT03" \ -i "pandas.Index.ravel PR01,RT03" \ -i "pandas.Index.reindex PR07" \ - -i "pandas.Index.shape SA01" \ - -i "pandas.Index.size SA01" \ -i "pandas.Index.slice_indexer PR07,RT03,SA01" \ -i "pandas.Index.slice_locs RT03" \ -i "pandas.Index.str PR01,SA01" \ @@ -357,7 +354,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.mode SA01" \ -i "pandas.Series.mul PR07" \ -i "pandas.Series.nbytes SA01" \ - -i "pandas.Series.ndim SA01" \ -i "pandas.Series.ne PR07,SA01" \ -i "pandas.Series.nunique RT03" \ -i "pandas.Series.pad PR01,SA01" \ @@ -377,7 +373,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Series.rtruediv PR07" \ -i "pandas.Series.sem PR01,RT03,SA01" \ -i "pandas.Series.shape SA01" \ - -i "pandas.Series.size SA01" \ -i "pandas.Series.skew RT03,SA01" \ -i "pandas.Series.sparse PR01,SA01" \ -i "pandas.Series.sparse.density SA01" \ diff --git a/pandas/core/base.py b/pandas/core/base.py index 95b203590b393..9b1251a4ef5d8 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -355,6 +355,13 @@ def ndim(self) -> Literal[1]: """ Number of dimensions of the underlying data, by definition 1. + See Also + -------- + Series.size: Return the number of elements in the underlying data. + Series.shape: Return a tuple of the shape of the underlying data. + Series.dtype: Return the dtype object of the underlying data. + Series.values: Return Series as ndarray or ndarray-like depending on the dtype. + Examples -------- >>> s = pd.Series(["Ant", "Bear", "Cow"]) @@ -440,6 +447,13 @@ def size(self) -> int: """ Return the number of elements in the underlying data. + See Also + -------- + Series.ndim: Number of dimensions of the underlying data, by definition 1. + Series.shape: Return a tuple of the shape of the underlying data. + Series.dtype: Return the dtype object of the underlying data. + Series.values: Return Series as ndarray or ndarray-like depending on the dtype. + Examples -------- For Series: diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 685291e690196..8ede401f37184 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -7104,6 +7104,13 @@ def shape(self) -> Shape: """ Return a tuple of the shape of the underlying data. + See Also + -------- + Index.size: Return the number of elements in the underlying data. + Index.ndim: Number of dimensions of the underlying data, by definition 1. + Index.dtype: Return the dtype object of the underlying data. + Index.values: Return an array representing the data in the Index. + Examples -------- >>> idx = pd.Index([1, 2, 3])