summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul <leeyspaul@users.noreply.github.com>2020-07-30 22:46:56 -0700
committerGitHub <noreply@github.com>2020-07-31 08:46:56 +0300
commitd67326db34d6268b0deeb61f71a57062ab0d7c4d (patch)
tree95a6cb71c05c1dde7c54ae6e5d4c7fda7c873ccd
parent6f0436d745d1a10b53c0fdbc484fbd942386f9ea (diff)
downloadnumpy-d67326db34d6268b0deeb61f71a57062ab0d7c4d.tar.gz
DOC: update val to be scalar or array like optional closes #16901 (#16907)
* DOC: update val to be scalar or array like optional closes #16901 Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
-rw-r--r--numpy/lib/index_tricks.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index 2833e1072..6093f7e9d 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -769,9 +769,11 @@ def fill_diagonal(a, val, wrap=False):
a : array, at least 2-D.
Array whose diagonal is to be filled, it gets modified in-place.
- val : scalar
- Value to be written on the diagonal, its type must be compatible with
- that of the array a.
+ val : scalar or array_like
+ Value(s) to write on the diagonal. If `val` is scalar, the value is
+ written along the diagonal. If array-like, the flattened `val` is
+ written along the diagonal, repeating if necessary to fill all
+ diagonal entries.
wrap : bool
For tall matrices in NumPy version up to 1.6.2, the