This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / positive

ufunc

numpy:positive

source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/__init__.py

Summary

Numerical positive, element-wise.

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

import numpy as np
x1 = np.array(([1., -1.]))
np.positive(x1)
The unary ``+`` operator can be used as a shorthand for ``np.positive`` on ndarrays.
x1 = np.array(([1., -1.]))
+x1

Aliases

  • numpy.positive