SciPy

scipy.sparse.dia_matrix.shape

property dia_matrix.shape

Get shape of a matrix.