Skip to content

DOC: Fix Numpy Docstring validation errors in pandas.api.extensions.ExtensionArray #59540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.api.extensions.ExtensionArray.insert PR07,RT03,SA01" \
-i "pandas.api.extensions.ExtensionArray.interpolate PR01,SA01" \
-i "pandas.api.extensions.ExtensionArray.isin PR07,RT03,SA01" \
-i "pandas.api.extensions.ExtensionArray.isna SA01" \
-i "pandas.api.extensions.ExtensionArray.nbytes SA01" \
-i "pandas.api.extensions.ExtensionArray.ndim SA01" \
-i "pandas.api.extensions.ExtensionArray.ravel RT03,SA01" \
-i "pandas.api.extensions.ExtensionArray.take RT03" \
-i "pandas.api.extensions.ExtensionArray.tolist RT03,SA01" \
-i "pandas.api.extensions.ExtensionArray.unique RT03,SA01" \
-i "pandas.api.extensions.ExtensionArray.view SA01" \
Expand Down
21 changes: 21 additions & 0 deletions pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,11 @@ def ndim(self) -> int:
"""
Extension Arrays are only allowed to be 1-dimensional.

See Also
--------
ExtensionArray.shape: Return a tuple of the array dimensions.
ExtensionArray.size: The number of elements in the array.

Examples
--------
>>> arr = pd.array([1, 2, 3])
Expand All @@ -662,6 +667,11 @@ def nbytes(self) -> int:
"""
The number of bytes needed to store this object in memory.

See Also
--------
ExtensionArray.shape: Return a tuple of the array dimensions.
ExtensionArray.size: The number of elements in the array.

Examples
--------
>>> pd.array([1, 2, 3]).nbytes
Expand Down Expand Up @@ -767,6 +777,11 @@ def isna(self) -> np.ndarray | ExtensionArraySupportsAnyAll:
an ndarray would be expensive, an ExtensionArray may be
returned.

See Also
--------
ExtensionArray.dropna: Return ExtensionArray without NA values.
ExtensionArray.fillna: Fill NA/NaN values using the specified method.

Notes
-----
If returning an ExtensionArray, then
Expand Down Expand Up @@ -1580,6 +1595,7 @@ def take(
Returns
-------
ExtensionArray
An array formed with selected `indices`.

Raises
------
Expand Down Expand Up @@ -1832,6 +1848,11 @@ def ravel(self, order: Literal["C", "F", "A", "K"] | None = "C") -> Self:
Returns
-------
ExtensionArray
A flattened view on the array.

See Also
--------
ExtensionArray.tolist: Return a list of the values.

Notes
-----
Expand Down
Loading