SparseSeries.from_coo()

pandas.SparseSeries.from_coo

classmethod SparseSeries.from_coo(A, dense_index=False)

Create a SparseSeries from a scipy.sparse.coo_matrix.

New in version 0.16.0.

Parameters:

A : scipy.sparse.coo_matrix

dense_index : bool, default False

If False (default), the SparseSeries index consists of only the coords of the non-null entries of the original coo_matrix. If True, the SparseSeries index consists of the full sorted (row, col) coordinates of the coo_matrix.