@@ -92,8 +92,8 @@ def from_coo(cls, A, dense_index: bool = False) -> Series:
92
92
... ([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])), shape=(3, 4)
93
93
... )
94
94
>>> A
95
- <3x4 sparse matrix of type '<class 'numpy. float64'> '
96
- with 3 stored elements in COOrdinate format >
95
+ <COOrdinate sparse matrix of dtype ' float64'
96
+ with 3 stored elements and shape (3, 4) >
97
97
98
98
>>> A.todense()
99
99
matrix([[0., 0., 1., 2.],
@@ -178,8 +178,8 @@ def to_coo(self, row_levels=(0,), column_levels=(1,), sort_labels: bool = False)
178
178
... row_levels=["A", "B"], column_levels=["C", "D"], sort_labels=True
179
179
... )
180
180
>>> A
181
- <3x4 sparse matrix of type '<class 'numpy. float64'> '
182
- with 3 stored elements in COOrdinate format >
181
+ <COOrdinate sparse matrix of dtype ' float64'
182
+ with 3 stored elements and shape (3, 4) >
183
183
>>> A.todense()
184
184
matrix([[0., 0., 1., 3.],
185
185
[3., 0., 0., 0.],
@@ -350,8 +350,8 @@ def to_coo(self):
350
350
--------
351
351
>>> df = pd.DataFrame({"A": pd.arrays.SparseArray([0, 1, 0, 1])})
352
352
>>> df.sparse.to_coo()
353
- <4x1 sparse matrix of type '<class 'numpy. int64'> '
354
- with 2 stored elements in COOrdinate format >
353
+ <COOrdinate sparse matrix of dtype ' int64'
354
+ with 2 stored elements and shape (4, 1) >
355
355
"""
356
356
import_optional_dependency ("scipy" )
357
357
from scipy .sparse import coo_matrix
0 commit comments