COO.
density
The ratio of nonzero to all elements in this array.
See also
COO.size
COO.nnz
Examples
>>> x = np.zeros((8, 8)) >>> x[0, :] = 1 >>> s = COO.from_numpy(x) >>> s.density 0.125