summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.py
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2023-01-25 23:13:40 -0800
committerRoss Barnowski <rossbar@berkeley.edu>2023-01-25 23:13:40 -0800
commit30a99cdf154e7a76573b5366c2872709b5347cf8 (patch)
tree07197ea94b5799316f90c3dd2a2a7bf0c6490a6f /numpy/lib/index_tricks.py
parent85f4667c718402f806ec9e21bdc971d26e0fd4c9 (diff)
downloadnumpy-30a99cdf154e7a76573b5366c2872709b5347cf8.tar.gz
DOC: Fix example spacing and move to end of docstring.
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r--numpy/lib/index_tricks.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index d81e899fc..323435e4f 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -1001,6 +1001,14 @@ def diag_indices_from(arr):
----------
arr : array, at least 2-D
+ See Also
+ --------
+ diag_indices
+
+ Notes
+ -----
+ .. versionadded:: 1.4.0
+
Examples
--------
@@ -1009,9 +1017,9 @@ def diag_indices_from(arr):
>>> a = np.arange(16).reshape(4, 4)
>>> a
array([[ 0, 1, 2, 3],
- [ 4, 5, 6, 7],
- [ 8, 9, 10, 11],
- [12, 13, 14, 15]])
+ [ 4, 5, 6, 7],
+ [ 8, 9, 10, 11],
+ [12, 13, 14, 15]])
Get the indices of the diagonal elements.
@@ -1027,14 +1035,6 @@ def diag_indices_from(arr):
>>> np.diag_indices(a.shape[0])
(array([0, 1, 2, 3]), array([0, 1, 2, 3]))
- See Also
- --------
- diag_indices
-
- Notes
- -----
- .. versionadded:: 1.4.0
-
"""
if not arr.ndim >= 2: