summaryrefslogtreecommitdiff
path: root/numpy/matrixlib/defmatrix.py
diff options
context:
space:
mode:
authorJulian Taylor <juliantaylor108@gmail.com>2017-02-25 16:39:43 +0100
committerGitHub <noreply@github.com>2017-02-25 16:39:43 +0100
commiteb271d95c0c9f3821009330d858a261b4b861bfe (patch)
tree4e076b45c91eacce30cdbdc0f3b80cad1118dcdd /numpy/matrixlib/defmatrix.py
parente9246860480b6c909e6e00c1cd4371b0e5fee1ce (diff)
parent38ce8097749ad69494926036250ed5b2de66184c (diff)
downloadnumpy-eb271d95c0c9f3821009330d858a261b4b861bfe.tar.gz
Merge pull request #8685 from eric-wieser/shape-to-ndim
ENH: add dtype.ndim
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")