Skip to content

Commit 7740c4e

Browse files
DOC: fix PR07,SA01,ES01 for pandas.arrays.SparseArray (#60250)
1 parent 2e3e694 commit 7740c4e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9191
-i "pandas.arrays.IntegerArray SA01" \
9292
-i "pandas.arrays.IntervalArray.length SA01" \
9393
-i "pandas.arrays.NumpyExtensionArray SA01" \
94-
-i "pandas.arrays.SparseArray PR07,SA01" \
9594
-i "pandas.arrays.TimedeltaArray PR07,SA01" \
9695
-i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \
9796
-i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \

pandas/core/arrays/sparse/array.py

+10
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,18 @@ class SparseArray(OpsMixin, PandasObject, ExtensionArray):
289289
"""
290290
An ExtensionArray for storing sparse data.
291291
292+
SparseArray efficiently stores data with a high frequency of a
293+
specific fill value (e.g., zeros), saving memory by only retaining
294+
non-fill elements and their indices. This class is particularly
295+
useful for large datasets where most values are redundant.
296+
292297
Parameters
293298
----------
294299
data : array-like or scalar
295300
A dense array of values to store in the SparseArray. This may contain
296301
`fill_value`.
297302
sparse_index : SparseIndex, optional
303+
Index indicating the locations of sparse elements.
298304
fill_value : scalar, optional
299305
Elements in data that are ``fill_value`` are not stored in the
300306
SparseArray. For memory savings, this should be the most common value
@@ -345,6 +351,10 @@ class SparseArray(OpsMixin, PandasObject, ExtensionArray):
345351
-------
346352
None
347353
354+
See Also
355+
--------
356+
SparseDtype : Dtype for sparse data.
357+
348358
Examples
349359
--------
350360
>>> from pandas.arrays import SparseArray

0 commit comments

Comments
 (0)