File tree Expand file tree Collapse file tree 4 files changed +28
-72
lines changed Expand file tree Collapse file tree 4 files changed +28
-72
lines changed Original file line number Diff line number Diff line change @@ -259,32 +259,6 @@ def nnz(self):
259
259
"""
260
260
return self .data .shape [0 ]
261
261
262
- @property
263
- def format (self ):
264
- """
265
- The storage format of this array.
266
-
267
- Returns
268
- -------
269
- str
270
- The storage format of this array.
271
-
272
- See Also
273
- -------
274
- [`scipy.sparse.dok_matrix.format`][] : The Scipy equivalent property.
275
-
276
- Examples
277
- -------
278
- >>> import sparse
279
- >>> s = sparse.random((5, 5), density=0.2, format="dok")
280
- >>> s.format
281
- 'dok'
282
- >>> t = sparse.random((5, 5), density=0.2, format="coo")
283
- >>> t.format
284
- 'coo'
285
- """
286
- return "gcxs"
287
-
288
262
@property
289
263
def nbytes (self ):
290
264
"""
Original file line number Diff line number Diff line change @@ -601,29 +601,6 @@ def nnz(self):
601
601
"""
602
602
return self .coords .shape [1 ]
603
603
604
- @property
605
- def format (self ):
606
- """
607
- The storage format of this array.
608
- Returns
609
- -------
610
- str
611
- The storage format of this array.
612
- See Also
613
- --------
614
- [`scipy.sparse.dok_matrix.format`][] : The Scipy equivalent property.
615
- Examples
616
- -------
617
- >>> import sparse
618
- >>> s = sparse.random((5, 5), density=0.2, format="dok")
619
- >>> s.format
620
- 'dok'
621
- >>> t = sparse.random((5, 5), density=0.2, format="coo")
622
- >>> t.format
623
- 'coo'
624
- """
625
- return "coo"
626
-
627
604
@property
628
605
def nbytes (self ):
629
606
"""
Original file line number Diff line number Diff line change @@ -272,29 +272,6 @@ def nnz(self):
272
272
"""
273
273
return len (self .data )
274
274
275
- @property
276
- def format (self ):
277
- """
278
- The storage format of this array.
279
- Returns
280
- -------
281
- str
282
- The storage format of this array.
283
- See Also
284
- -------
285
- [`scipy.sparse.dok_matrix.format`][] : The Scipy equivalent property.
286
- Examples
287
- -------
288
- >>> import sparse
289
- >>> s = sparse.random((5, 5), density=0.2, format="dok")
290
- >>> s.format
291
- 'dok'
292
- >>> t = sparse.random((5, 5), density=0.2, format="coo")
293
- >>> t.format
294
- 'coo'
295
- """
296
- return "dok"
297
-
298
275
@property
299
276
def nbytes (self ):
300
277
"""
Original file line number Diff line number Diff line change @@ -145,6 +145,34 @@ def size(self):
145
145
# returns a float64 for an empty shape.
146
146
return reduce (operator .mul , self .shape , 1 )
147
147
148
+ @property
149
+ def format (self ):
150
+ """
151
+ The storage format of this array.
152
+
153
+ Returns
154
+ -------
155
+ str
156
+ The storage format of this array.
157
+
158
+ See Also
159
+ -------
160
+ [`scipy.sparse.coo_matrix.format`][] : The Scipy equivalent property.
161
+ [`scipy.sparse.csr_matrix.format`][] : The Scipy equivalent property.
162
+ [`scipy.sparse.dok_matrix.format`][] : The Scipy equivalent property.
163
+
164
+ Examples
165
+ -------
166
+ >>> import sparse
167
+ >>> s = sparse.random((5, 5), density=0.2, format="dok")
168
+ >>> s.format
169
+ 'dok'
170
+ >>> t = sparse.random((5, 5), density=0.2, format="coo")
171
+ >>> t.format
172
+ 'coo'
173
+ """
174
+ return type (self ).__name__ .lower ()
175
+
148
176
@property
149
177
def density (self ):
150
178
"""
You can’t perform that action at this time.
0 commit comments