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 @@ -600,29 +600,6 @@ def nnz(self):
600
600
"""
601
601
return self .coords .shape [1 ]
602
602
603
- @property
604
- def format (self ):
605
- """
606
- The storage format of this array.
607
- Returns
608
- -------
609
- str
610
- The storage format of this array.
611
- See Also
612
- --------
613
- [`scipy.sparse.dok_matrix.format`][] : The Scipy equivalent property.
614
- Examples
615
- -------
616
- >>> import sparse
617
- >>> s = sparse.random((5, 5), density=0.2, format="dok")
618
- >>> s.format
619
- 'dok'
620
- >>> t = sparse.random((5, 5), density=0.2, format="coo")
621
- >>> t.format
622
- 'coo'
623
- """
624
- return "coo"
625
-
626
603
@property
627
604
def nbytes (self ):
628
605
"""
Original file line number Diff line number Diff line change @@ -271,29 +271,6 @@ def nnz(self):
271
271
"""
272
272
return len (self .data )
273
273
274
- @property
275
- def format (self ):
276
- """
277
- The storage format of this array.
278
- Returns
279
- -------
280
- str
281
- The storage format of this array.
282
- See Also
283
- -------
284
- [`scipy.sparse.dok_matrix.format`][] : The Scipy equivalent property.
285
- Examples
286
- -------
287
- >>> import sparse
288
- >>> s = sparse.random((5, 5), density=0.2, format="dok")
289
- >>> s.format
290
- 'dok'
291
- >>> t = sparse.random((5, 5), density=0.2, format="coo")
292
- >>> t.format
293
- 'coo'
294
- """
295
- return "dok"
296
-
297
274
@property
298
275
def nbytes (self ):
299
276
"""
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