Skip to content

Commit 617d020

Browse files
committed
fixed Series.sparse and Series.sparse.to_coo and removed from ci/code_checks.sh
1 parent 172e477 commit 617d020

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
134134
-i "pandas.Series.dt.tz_localize PR01,PR02" \
135135
-i "pandas.Series.dt.unit GL08" \
136136
-i "pandas.Series.pad PR01,SA01" \
137-
-i "pandas.Series.sparse PR01,SA01" \
138137
-i "pandas.Series.sparse.fill_value SA01" \
139138
-i "pandas.Series.sparse.from_coo PR07,SA01" \
140139
-i "pandas.Series.sparse.npoints SA01" \
141140
-i "pandas.Series.sparse.sp_values SA01" \
142-
-i "pandas.Series.sparse.to_coo PR07,RT03,SA01" \
143141
-i "pandas.Timedelta.asm8 SA01" \
144142
-i "pandas.Timedelta.ceil SA01" \
145143
-i "pandas.Timedelta.components SA01" \

pandas/core/arrays/sparse/accessor.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ class SparseAccessor(BaseAccessor, PandasDelegate):
4747
"""
4848
Accessor for SparseSparse from other sparse matrix data types.
4949
50+
Parameters
51+
----------
52+
data : Series or DataFrame
53+
The Series or DataFrame to which the SparseAccessor is attached.
54+
55+
See Also
56+
--------
57+
Series.sparse.to_coo : Create a scipy.sparse.coo_matrix from a Series with MultiIndex.
58+
Series.sparse.from_coo : Create a Series with sparse values from a scipy.sparse.coo_matrix.
59+
5060
Examples
5161
--------
5262
>>> ser = pd.Series([0, 0, 2, 2, 2], dtype="Sparse[int]")
@@ -135,7 +145,9 @@ def to_coo(
135145
Parameters
136146
----------
137147
row_levels : tuple/list
148+
MultiIndex levels to use for row coordinates, specified by name or index.
138149
column_levels : tuple/list
150+
MultiIndex levels to use for column coordinates, specified by name or index.
139151
sort_labels : bool, default False
140152
Sort the row and column labels before forming the sparse matrix.
141153
When `row_levels` and/or `column_levels` refer to a single level,
@@ -144,8 +156,15 @@ def to_coo(
144156
Returns
145157
-------
146158
y : scipy.sparse.coo_matrix
159+
The sparse matrix in coordinate format.
147160
rows : list (row labels)
161+
Labels corresponding to the row coordinates.
148162
columns : list (column labels)
163+
Labels corresponding to the column coordinates.
164+
165+
See Also
166+
--------
167+
Series.sparse.from_coo : Create a Series with sparse values from a scipy.sparse.coo_matrix.
149168
150169
Examples
151170
--------

0 commit comments

Comments
 (0)