SciPy

scipy.sparse.spmatrix.shape

property spmatrix.shape

Get shape of a matrix.