summaryrefslogtreecommitdiff
path: root/numpy/matrixlib/defmatrix.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/matrixlib/defmatrix.py')
-rw-r--r--numpy/matrixlib/defmatrix.py2
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")