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):
259259 """
260260 return self .data .shape [0 ]
261261
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-
288262 @property
289263 def nbytes (self ):
290264 """
Original file line number Diff line number Diff line change @@ -601,29 +601,6 @@ def nnz(self):
601601 """
602602 return self .coords .shape [1 ]
603603
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-
627604 @property
628605 def nbytes (self ):
629606 """
Original file line number Diff line number Diff line change @@ -272,29 +272,6 @@ def nnz(self):
272272 """
273273 return len (self .data )
274274
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-
298275 @property
299276 def nbytes (self ):
300277 """
Original file line number Diff line number Diff line change @@ -145,6 +145,34 @@ def size(self):
145145 # returns a float64 for an empty shape.
146146 return reduce (operator .mul , self .shape , 1 )
147147
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+
148176 @property
149177 def density (self ):
150178 """
You can’t perform that action at this time.
0 commit comments