@@ -98,8 +98,8 @@ def from_coo(cls, A, dense_index: bool = False) -> Series:
98
98
... ([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])), shape=(3, 4)
99
99
... )
100
100
>>> A
101
- <3x4 sparse matrix of type '<class 'numpy. float64'> '
102
- with 3 stored elements in COOrdinate format >
101
+ <COOrdinate sparse matrix of dtype ' float64'
102
+ with 3 stored elements and shape (3, 4) >
103
103
104
104
>>> A.todense()
105
105
matrix([[0., 0., 1., 2.],
@@ -186,8 +186,8 @@ def to_coo(
186
186
... row_levels=["A", "B"], column_levels=["C", "D"], sort_labels=True
187
187
... )
188
188
>>> A
189
- <3x4 sparse matrix of type '<class 'numpy. float64'> '
190
- with 3 stored elements in COOrdinate format >
189
+ <COOrdinate sparse matrix of dtype ' float64'
190
+ with 3 stored elements and shape (3, 4) >
191
191
>>> A.todense()
192
192
matrix([[0., 0., 1., 3.],
193
193
[3., 0., 0., 0.],
@@ -380,8 +380,8 @@ def to_coo(self) -> spmatrix:
380
380
--------
381
381
>>> df = pd.DataFrame({"A": pd.arrays.SparseArray([0, 1, 0, 1])})
382
382
>>> df.sparse.to_coo()
383
- <4x1 sparse matrix of type '<class 'numpy. int64'> '
384
- with 2 stored elements in COOrdinate format >
383
+ <COOrdinate sparse matrix of dtype ' int64'
384
+ with 2 stored elements and shape (4, 1) >
385
385
"""
386
386
import_optional_dependency ("scipy" )
387
387
from scipy .sparse import coo_matrix
0 commit comments