From df5c87f1b44b47fbf94029203d261c2e993c8f45 Mon Sep 17 00:00:00 2001 From: Garrett-R Date: Wed, 31 Dec 2014 12:50:52 +0530 Subject: DOC: Docstring of np.diagonal to reflect edits of PR #5358 These should have been included with PR #5358. --- numpy/core/fromnumeric.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'numpy/core/fromnumeric.py') 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). -- cgit v1.2.1