from scipy.sparse import csc_matrixcsc = csc_matrix(np.array( [[0, 0, 4, 0, 0, 0], [1, 0, 0, 0, 2, 0], [2, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1], [4, 0, 3, 2, 0, 0]]))# Return a Coordinate (coo) representation of the Compresses-Sparse-Column (csc) matrix.coo = csc.tocoo(copy=False)# Access `row`, `col` and `data` properties of coo matrix.>>> pd.Dataframe({'index': coo.row, 'col': coo.col, 'data': coo.data} )[['index', 'col', 'data']].sort_values(['index', 'col'] ).reset_index(drop=True) index col data0 0 2 41 1 0 12 1 4 23 2 0 24 2 3 15 3 5 16 4 0 47 4 2 38 4 3 2