DOK.to_coo

DOK.to_coo()[source]

Convert this DOK array to a COO array.

Returns:

The equivalent COO array.

Return type:

COO

Examples

>>> s = DOK((5, 5))
>>> s[1:3, 1:3] = [[4, 5], [6, 7]]
>>> s
<DOK: shape=(5, 5), dtype=float64, nnz=4, fill_value=0.0>
>>> s2 = s.to_coo()
>>> s2
<COO: shape=(5, 5), dtype=float64, nnz=4, fill_value=0.0>