xorbits.numpy.positive#

xorbits.numpy.positive(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj])[源代码]#

Numerical positive, element-wise.

1.13.0(numpy) 新版功能.

参数

x (array_like or scalar) – Input array.

返回

y – Returned array or scalar: y = +x. This is a scalar if x is a scalar.

返回类型

ndarray or scalar

提示

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

实际案例

>>> 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.])

This docstring was copied from numpy.