COO
GCXS
DOK
DOK.from_numpy()
Get a DOK array from a Numpy array.
x (np.ndarray) – The array to convert.
The equivalent DOK array.
Examples
>>> s = DOK.from_numpy(np.eye(4)) >>> s <DOK: shape=(4, 4), dtype=float64, nnz=4, fill_value=0.0>