Numerical positive, element-wise.
Input array.
Returned array or scalar: y = +x. This is a scalar if x is a scalar.
Equivalent to x.copy(), but only defined for types that support arithmetic.
>>> import numpy as np
>>> 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.])
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.positive.html