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/core/fromnumeric.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/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 84a10bf04..93ee07caa 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -1268,7 +1268,7 @@ def diagonal(a, offset=0, axis1=0, axis2=1): [5, 7]]) """ - return asarray(a).diagonal(offset, axis1, axis2) + return asanyarray(a).diagonal(offset, axis1, axis2) def trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None): |