Skip to content
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

DOC: fix docstring validation errors for pandas.Series #59633

Merged
merged 3 commits into from
Aug 28, 2024
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
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt.tz_localize PR01,PR02" \
-i "pandas.Series.dt.unit GL08" \
-i "pandas.Series.pad PR01,SA01" \
-i "pandas.Series.sparse PR01,SA01" \
-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.Series.sparse.to_coo PR07,RT03,SA01" \
-i "pandas.Timedelta.asm8 SA01" \
-i "pandas.Timedelta.ceil SA01" \
-i "pandas.Timedelta.components SA01" \
Expand Down
22 changes: 22 additions & 0 deletions pandas/core/arrays/sparse/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ class SparseAccessor(BaseAccessor, PandasDelegate):
"""
Accessor for SparseSparse from other sparse matrix data types.

Parameters
----------
data : Series or DataFrame
The Series or DataFrame to which the SparseAccessor is attached.

See Also
--------
Series.sparse.to_coo : Create a scipy.sparse.coo_matrix from a Series with
MultiIndex.
Series.sparse.from_coo : Create a Series with sparse values from a
scipy.sparse.coo_matrix.

Examples
--------
>>> ser = pd.Series([0, 0, 2, 2, 2], dtype="Sparse[int]")
Expand Down Expand Up @@ -135,7 +147,9 @@ def to_coo(
Parameters
----------
row_levels : tuple/list
MultiIndex levels to use for row coordinates, specified by name or index.
column_levels : tuple/list
MultiIndex levels to use for column coordinates, specified by name or index.
sort_labels : bool, default False
Sort the row and column labels before forming the sparse matrix.
When `row_levels` and/or `column_levels` refer to a single level,
Expand All @@ -144,8 +158,16 @@ def to_coo(
Returns
-------
y : scipy.sparse.coo_matrix
The sparse matrix in coordinate format.
rows : list (row labels)
Labels corresponding to the row coordinates.
columns : list (column labels)
Labels corresponding to the column coordinates.

See Also
--------
Series.sparse.from_coo : Create a Series with sparse values from a
scipy.sparse.coo_matrix.

Examples
--------
Expand Down