Skip to content

Commit 1fc552e

Browse files
KeiOshimapmhatre1
authored andcommitted
DOC: fixing SA01 errors for index.size, shape, and ndim. (pandas-dev#58333)
* Doc: fixing SA01 for index.size, shape, and ndim * EXPECTED TO FAIL, BUT NOT FAILING * changing from Index to Series for core/basy.py
1 parent 7aecf01 commit 1fc552e

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

ci/code_checks.sh

-5
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
173173
-i "pandas.Index.name SA01" \
174174
-i "pandas.Index.names GL08" \
175175
-i "pandas.Index.nbytes SA01" \
176-
-i "pandas.Index.ndim SA01" \
177176
-i "pandas.Index.nunique RT03" \
178177
-i "pandas.Index.putmask PR01,RT03" \
179178
-i "pandas.Index.ravel PR01,RT03" \
180179
-i "pandas.Index.reindex PR07" \
181-
-i "pandas.Index.shape SA01" \
182-
-i "pandas.Index.size SA01" \
183180
-i "pandas.Index.slice_indexer PR07,RT03,SA01" \
184181
-i "pandas.Index.slice_locs RT03" \
185182
-i "pandas.Index.str PR01,SA01" \
@@ -356,7 +353,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
356353
-i "pandas.Series.mode SA01" \
357354
-i "pandas.Series.mul PR07" \
358355
-i "pandas.Series.nbytes SA01" \
359-
-i "pandas.Series.ndim SA01" \
360356
-i "pandas.Series.ne PR07,SA01" \
361357
-i "pandas.Series.nunique RT03" \
362358
-i "pandas.Series.pad PR01,SA01" \
@@ -376,7 +372,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
376372
-i "pandas.Series.rtruediv PR07" \
377373
-i "pandas.Series.sem PR01,RT03,SA01" \
378374
-i "pandas.Series.shape SA01" \
379-
-i "pandas.Series.size SA01" \
380375
-i "pandas.Series.skew RT03,SA01" \
381376
-i "pandas.Series.sparse PR01,SA01" \
382377
-i "pandas.Series.sparse.density SA01" \

pandas/core/base.py

+14
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@ def ndim(self) -> Literal[1]:
355355
"""
356356
Number of dimensions of the underlying data, by definition 1.
357357
358+
See Also
359+
--------
360+
Series.size: Return the number of elements in the underlying data.
361+
Series.shape: Return a tuple of the shape of the underlying data.
362+
Series.dtype: Return the dtype object of the underlying data.
363+
Series.values: Return Series as ndarray or ndarray-like depending on the dtype.
364+
358365
Examples
359366
--------
360367
>>> s = pd.Series(["Ant", "Bear", "Cow"])
@@ -440,6 +447,13 @@ def size(self) -> int:
440447
"""
441448
Return the number of elements in the underlying data.
442449
450+
See Also
451+
--------
452+
Series.ndim: Number of dimensions of the underlying data, by definition 1.
453+
Series.shape: Return a tuple of the shape of the underlying data.
454+
Series.dtype: Return the dtype object of the underlying data.
455+
Series.values: Return Series as ndarray or ndarray-like depending on the dtype.
456+
443457
Examples
444458
--------
445459
For Series:

pandas/core/indexes/base.py

+7
Original file line numberDiff line numberDiff line change
@@ -7085,6 +7085,13 @@ def shape(self) -> Shape:
70857085
"""
70867086
Return a tuple of the shape of the underlying data.
70877087
7088+
See Also
7089+
--------
7090+
Index.size: Return the number of elements in the underlying data.
7091+
Index.ndim: Number of dimensions of the underlying data, by definition 1.
7092+
Index.dtype: Return the dtype object of the underlying data.
7093+
Index.values: Return an array representing the data in the Index.
7094+
70887095
Examples
70897096
--------
70907097
>>> idx = pd.Index([1, 2, 3])

0 commit comments

Comments
 (0)