SciPy

scipy.sparse.linalg.LinearOperator.ndim

LinearOperator.ndim = 2