10000 DOC: Document the new keyword arguments for ufuncs · numpy/numpy@bc03f06 · GitHub
[go: up one dir, main page]

Skip to content

Commit bc03f06

Browse files
committed
DOC: Document the new keyword arguments for ufuncs
1 parent 9e817bb commit bc03f06

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

doc/source/reference/ufuncs.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,44 @@ advanced usage and will not typically be used.
286286
.. index::
287287
pair: ufunc; keyword arguments
288288

289+
*out*
290+
291+
.. versionadded:: 1.6
292+
293+
The first output can provided as either a positional or a keyword parameter.
294+
295+
*casting*
296+
297+
.. versionadded:: 1.6
298+
299+
Provides a policy for what kind of casting is permitted. For compatibility
300+
with previous versions of NumPy, this defaults to 'unsafe'. May be 'no',
301+
'equiv', 'safe', 'same_kind', or 'unsafe'. See :func:`can_cast` for
302+
explanations of the parameter values.
303+
304+
*order*
305+
306+
.. versionadded:: 1.6
307+
308+
Specifies the calculation iteration order/memory layout of the output array.
309+
Defaults to 'K'. 'C' means the output should be C-contiguous, 'F' means
310+
F-contiguous, 'A' means F-contiguous if the inputs are F-contiguous, C-contiguous
311+
otherwise, and 'K' means to match the element ordering of the inputs
312+
as closely as possible.
313+
314+
*dtype*
315+
316+
.. versionadded:: 1.6
317+
318+
Overrides the dtype of the calculation and output arrays. Similar to *sig*.
319+
320+
*subok*
321+
322+
.. versionadded:: 1.6
323+
324+
Defaults to true. If set to false, the output will always be a strict
325+
array, not a subtype.
326+
289327
*sig*
290328

291329
Either a data-type, a tuple of data-types, or a special signature
@@ -310,6 +348,7 @@ advanced usage and will not typically be used.
310348
in a loop.
311349

312350

351+
313352
Attributes
314353
----------
315354

numpy/add_newdocs.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,8 +1552,15 @@ def luf(lamdaexpr, *args, **kwargs):
15521552
Data type, scalar, or array to cast from.
15531553
totype : dtype or dtype specifier
15541554
Data type to cast to.
1555-
casting : casting rule
1556-
May be any of 'no', 'equiv', 'safe', 'same_kind', or 'unsafe'.
1555+
casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
1556+
Controls what kind of data casting may occur.
1557+
1558+
* 'no' means the data types should not be cast at all.
1559+
* 'equiv' means only byte-order changes are allowed.
1560+
* 'safe' means only casts which can preserve values are allowed.
1561+
* 'same_kind' means only safe casts or casts within a kind,
1562+
like float64 to float32, are allowed.
1563+
* 'unsafe' means any data conversions may be done.
15571564
15581565
Returns
15591566
-------

0 commit comments

Comments
 (0)
0