diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-02-24 16:46:58 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-02-24 16:46:58 +0000 |
commit | 48783e5ceb7f60c33db81ab72e5024f42b220990 (patch) | |
tree | 2284b780e521418b0e73fd7283403d3e7e28da50 /numpy/matrixlib/defmatrix.py | |
parent | 5f5ccecbfc116284ed8c8d53cd8b203ceef5f7c7 (diff) | |
download | numpy-48783e5ceb7f60c33db81ab72e5024f42b220990.tar.gz |
MAINT: replace len(x.shape) with x.ndim
Diffstat (limited to 'numpy/matrixlib/defmatrix.py')
-rw-r--r-- | numpy/matrixlib/defmatrix.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/matrixlib/defmatrix.py b/numpy/matrixlib/defmatrix.py index 6c7640cb8..bd14846c6 100644 --- a/numpy/matrixlib/defmatrix.py +++ b/numpy/matrixlib/defmatrix.py @@ -169,7 +169,7 @@ def matrix_power(M, n): """ M = asanyarray(M) - if len(M.shape) != 2 or M.shape[0] != M.shape[1]: + if M.ndim != 2 or M.shape[0] != M.shape[1]: raise ValueError("input must be a square array") if not issubdtype(type(n), int): raise TypeError("exponent must be an integer") |