diff options
author | Garrett-R <garrettreynolds5@gmail.com> | 2014-12-08 20:33:48 -0800 |
---|---|---|
committer | Garrett-R <garrettreynolds5@gmail.com> | 2014-12-08 20:33:48 -0800 |
commit | 819b3a8a019469774a5343afd87ec71ec696bf80 (patch) | |
tree | c4bf6458781941e24b489b2066fbf755f8deeb2a /numpy/lib/twodim_base.py | |
parent | b8a5da49675009165326ec2e7aa6968cf6e15782 (diff) | |
download | numpy-819b3a8a019469774a5343afd87ec71ec696bf80.tar.gz |
BUG: Closes #2015: diag returns ndarray
If x is a matrix, np.diag(x) and np.diagonal(x) now return matrices
instead of arrays. Both of these cause x.diagonal() to be called.
That means they return row vectors (just like x.flatten(), x.ravel(),
x.cumprod(), etc.)
Diffstat (limited to 'numpy/lib/twodim_base.py')
-rw-r--r-- | numpy/lib/twodim_base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py index 40a140b6b..0c5065fa1 100644 --- a/numpy/lib/twodim_base.py +++ b/numpy/lib/twodim_base.py @@ -293,7 +293,7 @@ def diag(v, k=0): [0, 0, 8]]) """ - v = asarray(v) + v = asanyarray(v) s = v.shape if len(s) == 1: n = s[0]+abs(k) |