summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorGarrett-R <garrettreynolds5@gmail.com>2014-12-31 12:50:52 +0530
committerGarrett-R <garrettreynolds5@gmail.com>2015-01-01 17:10:31 +0530
commitdf5c87f1b44b47fbf94029203d261c2e993c8f45 (patch)
tree3f832351f15a8b466a1967ba4a6342026870f8cb /numpy/core/fromnumeric.py
parentfb898ce678c8d45364d1ee7b1a6d0308562a8ad9 (diff)
downloadnumpy-df5c87f1b44b47fbf94029203d261c2e993c8f45.tar.gz
DOC: Docstring of np.diagonal to reflect edits of PR #5358
These should have been included with PR #5358.
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 321deb014..c14d2e357 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1191,8 +1191,9 @@ def diagonal(a, offset=0, axis1=0, axis2=1):
In NumPy 1.9 it returns a read-only view on the original array.
Attempting to write to the resulting array will produce an error.
- In NumPy 1.10, it will return a read/write view, Writing to the returned
- array will alter your original array.
+ In NumPy 1.10, it will return a read/write view and writing to the
+ returned array will alter your original array. The returned array
+ will have the same type as the input array.
If you don't write to the array returned by this function, then you can
just ignore all of the above.
@@ -1219,7 +1220,8 @@ def diagonal(a, offset=0, axis1=0, axis2=1):
Returns
-------
array_of_diagonals : ndarray
- If `a` is 2-D, a 1-D array containing the diagonal is returned.
+ If `a` is 2-D, a 1-D array of the same type as `a` containing the
+ diagonal is returned (or 2-D matrix for matrix input).
If the dimension of `a` is larger, then an array of diagonals is
returned, "packed" from left-most dimension to right-most (e.g.,
if `a` is 3-D, then the diagonals are "packed" along rows).