From cd7aa18d41eb7d8c9c62633d8227567a98d44176 Mon Sep 17 00:00:00 2001 From: Hao Jin Date: Tue, 7 Jan 2020 16:28:55 -0800 Subject: Update doc for np.full Previous document was not properly documenting the case when `fill_value` is an array_like object. --- numpy/core/numeric.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'numpy/core/numeric.py') 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 -- cgit v1.2.1