Skip to content

DOC: fix SA01, ES01 for pandas.Series.sparse.sp_values #59859

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
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.sparse.fill_value SA01" \
-i "pandas.Series.sparse.from_coo PR07,SA01" \
-i "pandas.Series.sparse.npoints SA01" \
-i "pandas.Series.sparse.sp_values SA01" \
-i "pandas.Timedelta.max PR02" \
-i "pandas.Timedelta.min PR02" \
-i "pandas.Timedelta.resolution PR02" \
Expand Down
12 changes: 12 additions & 0 deletions pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,18 @@ def sp_values(self) -> np.ndarray:
"""
An ndarray containing the non- ``fill_value`` values.

This property returns the actual data values stored in the sparse
representation, excluding the values that are equal to the ``fill_value``.
The result is an ndarray of the underlying values, preserving the sparse
structure by omitting the default ``fill_value`` entries.

See Also
--------
Series.sparse.to_dense : Convert a Series from sparse values to dense.
Series.sparse.fill_value : Elements in `data` that are `fill_value` are
not stored.
Series.sparse.density : The percent of non- ``fill_value`` points, as decimal.

Examples
--------
>>> from pandas.arrays import SparseArray
Expand Down
Loading