8000 Merge pull request #10679 from NelleV/10611_docstrings · numpy/numpy@2d44de2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d44de2

Browse files
authored
Merge pull request #10679 from NelleV/10611_docstrings
DOC zeros, empty, and ones now have consistent docstrings
2 parents a8b8830 + 5a23878 commit 2d44de2

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

numpy/add_newdocs.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,11 @@ def luf(lamdaexpr, *args, **kwargs):
845845
Parameters
846846
----------
847847
shape : int or tuple of int
848-
Shape of the empty array
848+
Shape of the empty array, e.g., ``(2, 3)`` or ``2``.
849849
dtype : data-type, optional
850-
Desired output data-type.
851-
order : {'C', 'F'}, optional
850+
Desired output data-type for the array, e.g, `numpy.int8`. Default is
851+
`numpy.float64`.
852+
order : {'C', 'F'}, optional, default: 'C'
852853
Whether to store multi-dimensional data in row-major
853854
(C-style) or column-major (Fortran-style) order in
854855
memory.
@@ -965,14 +966,15 @@ def luf(lamdaexpr, *args, **kwargs):
965966
966967
Parameters
967968
----------
968-
shape : int or sequence of ints
969+
shape : int or tuple of ints
969970
Shape of the new array, e.g., ``(2, 3)`` or ``2``.
970971
dtype : data-type, optional
971972
The desired data-type for the array, e.g., `numpy.int8`. Default is
972973
`numpy.float64`.
973-
order : {'C', 'F'}, optional
974-
Whether to store multidimensional data in C- or Fortran-contiguous
975-
(row- or column-wise) order in memory.
974+
order : {'C', 'F'}, optional, default: 'C'
975+
Whether to store multi-dimensional data in row-major
976+
(C-style) or column-major (Fortran-style) order in
977+
memory.
976978
977979
Returns
978980
-------

numpy/core/numeric.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ def ones(shape, dtype=None, order='C'):
160160
dtype : data-type, optional
161161
The desired data-type for the array, e.g., `numpy.int8`. Default is
162162
`numpy.float64`.
163-
order : {'C', 'F'}, optional
164-
Whether to store multidimensional data in C- or Fortran-contiguous
165-
(row- or column-wise) order in memory.
163+
order : {'C', 'F'}, optional, default: C
164+
Whether to store multi-dimensional data in row-major
165+
(C-style) or column-major (Fortran-style) order in
166+
memory.
166167
167168
Returns
168169
-------

0 commit comments

Comments
 (0)
0