Skip to content

Commit 64aa9be

Browse files
abhinav-thimmaathimma2mroeschke
authored
DOC: Fix Numpy Docstring validation errors in pandas.api.extensions.ExtensionArray (#59540)
* Fix SA01 for isna * Fix See Also for nbytes * fix See also for ndim * Fix ravel * fis return value of take * remove type ignore --------- Co-authored-by: Abhinav Thimma <[email protected]> Co-authored-by: Matthew Roeschke <[email protected]>
1 parent ca2b8c3 commit 64aa9be

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

ci/code_checks.sh

-5
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
224224
-i "pandas.api.extensions.ExtensionArray.insert PR07,RT03,SA01" \
225225
-i "pandas.api.extensions.ExtensionArray.interpolate PR01,SA01" \
226226
-i "pandas.api.extensions.ExtensionArray.isin PR07,RT03,SA01" \
227-
-i "pandas.api.extensions.ExtensionArray.isna SA01" \
228-
-i "pandas.api.extensions.ExtensionArray.nbytes SA01" \
229-
-i "pandas.api.extensions.ExtensionArray.ndim SA01" \
230-
-i "pandas.api.extensions.ExtensionArray.ravel RT03,SA01" \
231-
-i "pandas.api.extensions.ExtensionArray.take RT03" \
232227
-i "pandas.api.extensions.ExtensionArray.tolist RT03,SA01" \
233228
-i "pandas.api.extensions.ExtensionArray.unique RT03,SA01" \
234229
-i "pandas.api.extensions.ExtensionArray.view SA01" \

pandas/core/arrays/base.py

+21
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,11 @@ def ndim(self) -> int:
649649
"""
650650
Extension Arrays are only allowed to be 1-dimensional.
651651
652+
See Also
653+
--------
654+
ExtensionArray.shape: Return a tuple of the array dimensions.
655+
ExtensionArray.size: The number of elements in the array.
656+
652657
Examples
653658
--------
654659
>>> arr = pd.array([1, 2, 3])
@@ -662,6 +667,11 @@ def nbytes(self) -> int:
662667
"""
663668
The number of bytes needed to store this object in memory.
664669
670+
See Also
671+
--------
672+
ExtensionArray.shape: Return a tuple of the array dimensions.
673+
ExtensionArray.size: The number of elements in the array.
674+
665675
Examples
666676
--------
667677
>>> pd.array([1, 2, 3]).nbytes
@@ -767,6 +777,11 @@ def isna(self) -> np.ndarray | ExtensionArraySupportsAnyAll:
767777
an ndarray would be expensive, an ExtensionArray may be
768778
returned.
769779
780+
See Also
781+
--------
782+
ExtensionArray.dropna: Return ExtensionArray without NA values.
783+
ExtensionArray.fillna: Fill NA/NaN values using the specified method.
784+
770785
Notes
771786
-----
772787
If returning an ExtensionArray, then
@@ -1580,6 +1595,7 @@ def take(
15801595
Returns
15811596
-------
15821597
ExtensionArray
1598+
An array formed with selected `indices`.
15831599
15841600
Raises
15851601
------
@@ -1832,6 +1848,11 @@ def ravel(self, order: Literal["C", "F", "A", "K"] | None = "C") -> Self:
18321848
Returns
18331849
-------
18341850
ExtensionArray
1851+
A flattened view on the array.
1852+
1853+
See Also
1854+
--------
1855+
ExtensionArray.tolist: Return a list of the values.
18351856
18361857
Notes
18371858
-----

0 commit comments

Comments
 (0)