SparseArray.todense¶
-
abstract
SparseArray.todense()[source]¶ Convert this
SparseArrayarray to a densenumpy.ndarray. Note that this may take a large amount of memory and time.- Returns
The converted dense array.
- Return type
See also
DOK.todense()Equivalent
DOKarray method.COO.todense()Equivalent
COOarray method.scipy.sparse.coo_matrix.todense()Equivalent Scipy method.
Examples
>>> import sparse >>> x = np.random.randint(100, size=(7, 3)) >>> s = sparse.COO.from_numpy(x) >>> x2 = s.todense() >>> np.array_equal(x, x2) True