summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-03-01 17:21:13 -0700
committerGitHub <noreply@github.com>2018-03-01 17:21:13 -0700
commit2d44de214d63c5fc610392d1e18fa93615b12c1a (patch)
tree9a72624d7dbb89c5abf11c561f53ad01b2f247e3
parenta8b8830ca0ff7e437db7801ed63910de8b35318e (diff)
parent5a238789894a1f21961217eaaae3e18bcf6ea7c7 (diff)
downloadnumpy-2d44de214d63c5fc610392d1e18fa93615b12c1a.tar.gz
Merge pull request #10679 from NelleV/10611_docstrings
DOC zeros, empty, and ones now have consistent docstrings
-rw-r--r--numpy/add_newdocs.py16
-rw-r--r--numpy/core/numeric.py7
2 files changed, 13 insertions, 10 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 9740292bb..38da1f0b3 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -845,10 +845,11 @@ add_newdoc('numpy.core.multiarray', 'empty',
Parameters
----------
shape : int or tuple of int
- Shape of the empty array
+ Shape of the empty array, e.g., ``(2, 3)`` or ``2``.
dtype : data-type, optional
- Desired output data-type.
- order : {'C', 'F'}, optional
+ Desired output data-type for the array, e.g, `numpy.int8`. Default is
+ `numpy.float64`.
+ order : {'C', 'F'}, optional, default: 'C'
Whether to store multi-dimensional data in row-major
(C-style) or column-major (Fortran-style) order in
memory.
@@ -965,14 +966,15 @@ add_newdoc('numpy.core.multiarray', 'zeros',
Parameters
----------
- shape : int or sequence of ints
+ shape : int or tuple 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.
+ order : {'C', 'F'}, optional, default: 'C'
+ Whether to store multi-dimensional data in row-major
+ (C-style) or column-major (Fortran-style) order in
+ memory.
Returns
-------
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index d2d59d9b2..1f249ae6c 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -160,9 +160,10 @@ def ones(shape, dtype=None, order='C'):
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.
+ order : {'C', 'F'}, optional, default: C
+ Whether to store multi-dimensional data in row-major
+ (C-style) or column-major (Fortran-style) order in
+ memory.
Returns
-------