DOK.from_coo

classmethod DOK.from_coo(x)[source]

Get a DOK array from a COO array.

Parameters:

x (COO) – The array to convert.

Returns:

The equivalent DOK array.

Return type:

DOK

Examples

>>> from sparse import COO
>>> s = COO.from_numpy(np.eye(4))
>>> s2 = DOK.from_coo(s)
>>> s2
<DOK: shape=(4, 4), dtype=float64, nnz=4, fill_value=0.0>