SciPy

scipy.sparse.coo_matrix.reshape

coo_matrix.reshape(shape)[source]