summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorJohannes Schönberger <jschoenberger@demuc.de>2013-05-06 21:06:02 +0200
committerJohannes Schönberger <jschoenberger@demuc.de>2013-06-06 21:15:45 +0200
commit494fa219b050cb3b1564e78499c8306ea514aa35 (patch)
treeea7dc0c62286f3ac995e2e706e42aba5a11f0534 /numpy/core/numeric.py
parent8ed3733b895150751d719f5c9b491671615f4b46 (diff)
downloadnumpy-494fa219b050cb3b1564e78499c8306ea514aa35.tar.gz
Add separate parameter description to filled, filled_like and ones
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py41
1 files changed, 35 insertions, 6 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index ce05b3a3f..d0ae5e6eb 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -137,7 +137,21 @@ def ones(shape, dtype=None, order='C'):
"""
Return a new array of given shape and type, filled with ones.
- Please refer to the documentation for `zeros` for further details.
+ Parameters
+ ----------
+ shape : int or sequence of ints
+ Shape of the new array, e.g., ``(2, 3)`` or ``2``.
+ dtype : data-type, optional
+ The desired data-type for the array, e.g., `numpy.int8`. Default is
+ `numpy.float64`.
+ order : {'C', 'F'}, optional
+ Whether to store multidimensional data in C- or Fortran-contiguous
+ (row- or column-wise) order in memory.
+
+ Returns
+ -------
+ out : ndarray
+ Array of ones with the given shape, dtype, and order.
See Also
--------
@@ -227,12 +241,23 @@ def filled(shape, val, dtype=None, order='C'):
"""
Return a new array of given shape and type, filled with `val`.
- Please refer to the documentation for `zeros` for further details.
-
- Other parameters
- ----------------
+ Parameters
+ ----------
+ shape : int or sequence of ints
+ Shape of the new array, e.g., ``(2, 3)`` or ``2``.
val : scalar
Fill value.
+ dtype : data-type, optional
+ The desired data-type for the array, e.g., `numpy.int8`. Default is
+ `numpy.float64`.
+ order : {'C', 'F'}, optional
+ Whether to store multidimensional data in C- or Fortran-contiguous
+ (row- or column-wise) order in memory.
+
+ Returns
+ -------
+ out : ndarray
+ Array of `val` with the given shape, dtype, and order.
See Also
--------
@@ -267,11 +292,15 @@ def filled_like(a, val, dtype=None, order='K', subok=True):
'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
'C' otherwise. 'K' means match the layout of `a` as closely
as possible.
+ subok : bool, optional.
+ If True, then the newly created array will use the sub-class
+ type of 'a', otherwise it will be a base-class array. Defaults
+ to True.
Returns
-------
out : ndarray
- Array of nans with the same shape and type as `a`.
+ Array of `val` with the same shape and type as `a`.
See Also
--------