SparseArray¶
-
class
sparse.SparseArray(shape, fill_value=None)[source]¶ An abstract base class for all the sparse array classes.
-
dtype¶ The data type of this array.
Type: numpy.dtype
-
fill_value¶ The fill value of this array.
Type: scalar
Attributes
SparseArray.densityThe ratio of nonzero to all elements in this array. SparseArray.ndimThe number of dimensions of this array. SparseArray.nnzThe number of nonzero elements in this array. SparseArray.sizeThe number of all elements (including zeros) in this array. Methods
SparseArray.asformat(format)Convert this sparse array to a given format. SparseArray.todense()Convert this SparseArrayarray to a densenumpy.ndarray.-