summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorHao Jin <hjjn.amzn@gmail.com>2020-01-07 16:28:55 -0800
committerGitHub <noreply@github.com>2020-01-07 16:28:55 -0800
commitcd7aa18d41eb7d8c9c62633d8227567a98d44176 (patch)
tree6f5eec06b64a2542c38ce31767c88451870a7d90 /numpy/core/numeric.py
parent7d159b48a1c98159ff1623b33abbd408a11df1f6 (diff)
downloadnumpy-cd7aa18d41eb7d8c9c62633d8227567a98d44176.tar.gz
Update doc for np.full
Previous document was not properly documenting the case when `fill_value` is an array_like object.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index f18ab6336..5a1cbe9fc 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -282,7 +282,7 @@ def full(shape, fill_value, dtype=None, order='C'):
----------
shape : int or sequence of ints
Shape of the new array, e.g., ``(2, 3)`` or ``2``.
- fill_value : scalar
+ fill_value : scalar or array_like
Fill value.
dtype : data-type, optional
The desired data-type for the array The default, None, means
@@ -312,6 +312,10 @@ def full(shape, fill_value, dtype=None, order='C'):
array([[10, 10],
[10, 10]])
+ >>> np.full((2, 2), [1, 2])
+ array([[1, 2],
+ [1, 2]])
+
"""
if dtype is None:
dtype = array(fill_value).dtype