diff options
author | Johannes Schönberger <jschoenberger@demuc.de> | 2013-05-06 21:51:39 +0200 |
---|---|---|
committer | Johannes Schönberger <jschoenberger@demuc.de> | 2013-06-06 21:15:45 +0200 |
commit | 8b6ccd992e8d948438e2c39aaea8ccb156350445 (patch) | |
tree | a51bf0272fae6abb4dd0a3049d5f943dd540c916 /numpy/core/numeric.py | |
parent | 91b1b99fa01d6c9991cc833f36beef87d3c0c595 (diff) | |
download | numpy-8b6ccd992e8d948438e2c39aaea8ccb156350445.tar.gz |
Rename fill value parameter for consistency across numpy+
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index d3199cdea..eb70c2e04 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -237,15 +237,15 @@ def ones_like(a, dtype=None, order='K', subok=True): multiarray.copyto(res, 1, casting='unsafe') return res -def filled(shape, val, dtype=None, order='C'): +def filled(shape, fill_value, dtype=None, order='C'): """ - Return a new array of given shape and type, filled with `val`. + Return a new array of given shape and type, filled with `fill_value`. Parameters ---------- shape : int or sequence of ints Shape of the new array, e.g., ``(2, 3)`` or ``2``. - val : scalar + fill_value : scalar Fill value. dtype : data-type, optional The desired data-type for the array, e.g., `numpy.int8`. Default is @@ -257,7 +257,7 @@ def filled(shape, val, dtype=None, order='C'): Returns ------- out : ndarray - Array of `val` with the given shape, dtype, and order. + Array of `fill_value` with the given shape, dtype, and order. See Also -------- @@ -280,10 +280,10 @@ def filled(shape, val, dtype=None, order='C'): """ a = empty(shape, dtype, order) - multiarray.copyto(a, val, casting='unsafe') + multiarray.copyto(a, fill_value, casting='unsafe') return a -def filled_like(a, val, dtype=None, order='K', subok=True): +def filled_like(a, fill_value, dtype=None, order='K', subok=True): """ Return a filled array with the same shape and type as a given array. @@ -292,7 +292,7 @@ def filled_like(a, val, dtype=None, order='K', subok=True): a : array_like The shape and data-type of `a` define these same attributes of the returned array. - val : scalar + fill_value : scalar Fill value. dtype : data-type, optional Overrides the data type of the result. @@ -309,7 +309,7 @@ def filled_like(a, val, dtype=None, order='K', subok=True): Returns ------- out : ndarray - Array of `val` with the same shape and type as `a`. + Array of `fill_value` with the same shape and type as `a`. See Also -------- @@ -339,7 +339,7 @@ def filled_like(a, val, dtype=None, order='K', subok=True): """ res = empty_like(a, dtype=dtype, order=order, subok=subok) - multiarray.copyto(res, val, casting='unsafe') + multiarray.copyto(res, fill_value, casting='unsafe') return res |