Skip to content

Commit

Permalink
DOC: fix SA01, ES01 for pandas.Series.sparse.npoints (#59896)
Browse files Browse the repository at this point in the history
* DOC: fix SA01, ES01 for pandas.Series.sparse.npoints

* Update pandas/core/arrays/sparse/array.py
  • Loading branch information
tuhinsharma121 authored Sep 28, 2024
1 parent 5ced458 commit 96de1f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt.unit GL08" \
-i "pandas.Series.pad PR01,SA01" \
-i "pandas.Series.sparse.from_coo PR07,SA01" \
-i "pandas.Series.sparse.npoints 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 @@ -708,6 +708,18 @@ def npoints(self) -> int:
"""
The number of non- ``fill_value`` points.
This property returns the number of elements in the sparse series that are
not equal to the ``fill_value``. Sparse data structures store only the
non-``fill_value`` elements, reducing memory usage when the majority of
values are the same.
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

0 comments on commit 96de1f1

Please sign in to comment.