as_coo

sparse.as_coo(x, shape=None, fill_value=None)[source]

Converts any given format to COO. See the “See Also” section for details.

Parameters
Returns

out – The converted COO array.

Return type

COO

See also

SparseArray.asformat

A utility function to convert between formats in this library.

COO.from_numpy

Convert a Numpy array to COO.

COO.from_scipy_sparse

Convert a SciPy sparse matrix to COO.

COO.from_iter

Convert an iterable to COO.