Examples
import numpy as np import pandas as pd
import scipy.sparse mat = scipy.sparse.eye(3) pd.DataFrame.sparse.from_spmatrix(mat)