diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 567ae6da92ae2..ac53b176f20c9 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -579,9 +579,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX02 --ignore_functions \ pandas.DataFrame.plot.line \ pandas.Series.plot.line \ - pandas.Series.sparse.density \ - pandas.Series.sparse.npoints \ - pandas.Series.sparse.sp_values \ pandas.Timestamp.fromtimestamp \ pandas.api.types.infer_dtype \ pandas.api.types.is_datetime64_any_dtype \ diff --git a/pandas/core/arrays/sparse/array.py b/pandas/core/arrays/sparse/array.py index 7469e92436e1a..6860c1314bbf1 100644 --- a/pandas/core/arrays/sparse/array.py +++ b/pandas/core/arrays/sparse/array.py @@ -611,6 +611,7 @@ def sp_values(self) -> np.ndarray: Examples -------- + >>> from pandas.arrays import SparseArray >>> s = SparseArray([0, 0, 1, 0, 2], fill_value=0) >>> s.sp_values array([1, 2]) @@ -674,6 +675,7 @@ def density(self) -> float: Examples -------- + >>> from pandas.arrays import SparseArray >>> s = SparseArray([0, 0, 1, 1, 1], fill_value=0) >>> s.density 0.6 @@ -687,6 +689,7 @@ def npoints(self) -> int: Examples -------- + >>> from pandas.arrays import SparseArray >>> s = SparseArray([0, 0, 1, 1, 1], fill_value=0) >>> s.npoints 3