SciPy

scipy.sparse.lil_matrix.shape

lil_matrix.shape