diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-07-12 22:36:33 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-07-12 22:36:33 +0000 |
commit | 656cca10fa0ad2f504c17d9db25e156bc84ec554 (patch) | |
tree | cb5fbd67ffd1fd6b16ee07b78f9de98e35327c9c /numpy/core/defmatrix.py | |
parent | 07af346db0370c2709e545fe283123d4d9b2bd97 (diff) | |
download | numpy-656cca10fa0ad2f504c17d9db25e156bc84ec554.tar.gz |
Fixed #1162: make matrix_power accept lists etc. as input
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r-- | numpy/core/defmatrix.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py index cbb338469..354e40060 100644 --- a/numpy/core/defmatrix.py +++ b/numpy/core/defmatrix.py @@ -2,7 +2,7 @@ __all__ = ['matrix', 'bmat', 'mat', 'asmatrix'] import sys import numeric as N -from numeric import concatenate, isscalar, binary_repr, identity +from numeric import concatenate, isscalar, binary_repr, identity, asanyarray from numerictypes import issubdtype # make translation table @@ -115,6 +115,7 @@ def matrix_power(M,n): [ 0, -1]]) """ + M = asanyarray(M) if len(M.shape) != 2 or M.shape[0] != M.shape[1]: raise ValueError("input must be a square array") if not issubdtype(type(n),int): |