Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « numpy »

Fonction positive - module numpy

Signature de la fonction positive

Description

positive.__doc__

positive(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj])

Numerical positive, element-wise.

.. versionadded:: 1.13.0

Parameters
----------
x : array_like or scalar
    Input array.

Returns
-------
y : ndarray or scalar
    Returned array or scalar: `y = +x`.
    This is a scalar if `x` is a scalar.

Notes
-----
Equivalent to `x.copy()`, but only defined for types that support
arithmetic.

Examples
--------

>>> x1 = np.array(([1., -1.]))
>>> np.positive(x1)
array([ 1., -1.])

The unary ``+`` operator can be used as a shorthand for ``np.positive`` on
ndarrays.

>>> x1 = np.array(([1., -1.]))
>>> +x1
array([ 1., -1.])