SciPy

scipy.sparse.lil_matrix.reshape

lil_matrix.reshape(shape)[source]