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 @@ -600,29 +600,6 @@ def nnz(self):
600600 """
601601 return self .coords .shape [1 ]
602602
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-
626603 @property
627604 def nbytes (self ):
628605 """
Original file line number Diff line number Diff line change @@ -271,29 +271,6 @@ def nnz(self):
271271 """
272272 return len (self .data )
273273
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-
297274 @property
298275 def nbytes (self ):
299276 """
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