Skip to content

Commit 96de1f1

Browse files
DOC: fix SA01, ES01 for pandas.Series.sparse.npoints (pandas-dev#59896)
* DOC: fix SA01, ES01 for pandas.Series.sparse.npoints * Update pandas/core/arrays/sparse/array.py
1 parent 5ced458 commit 96de1f1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9797
-i "pandas.Series.dt.unit GL08" \
9898
-i "pandas.Series.pad PR01,SA01" \
9999
-i "pandas.Series.sparse.from_coo PR07,SA01" \
100-
-i "pandas.Series.sparse.npoints SA01" \
101100
-i "pandas.Timedelta.max PR02" \
102101
-i "pandas.Timedelta.min PR02" \
103102
-i "pandas.Timedelta.resolution PR02" \

pandas/core/arrays/sparse/array.py

+12
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,18 @@ def npoints(self) -> int:
708708
"""
709709
The number of non- ``fill_value`` points.
710710
711+
This property returns the number of elements in the sparse series that are
712+
not equal to the ``fill_value``. Sparse data structures store only the
713+
non-``fill_value`` elements, reducing memory usage when the majority of
714+
values are the same.
715+
716+
See Also
717+
--------
718+
Series.sparse.to_dense : Convert a Series from sparse values to dense.
719+
Series.sparse.fill_value : Elements in ``data`` that are ``fill_value`` are
720+
not stored.
721+
Series.sparse.density : The percent of non- ``fill_value`` points, as decimal.
722+
711723
Examples
712724
--------
713725
>>> from pandas.arrays import SparseArray

0 commit comments

Comments
 (0)