numpy.power()

numpy.power

numpy.power(x1, x2[, out]) =

First array elements raised to powers from second array, element-wise.

Raise each base in x1 to the positionally-corresponding power in x2. x1 and x2 must be broadcastable to the same shape.

Parameters:

x1 : array_like

The bases.

x2 : array_like

The exponents.

Returns:

y : ndarray

The bases in x1 raised to the exponents in x2.

登录查看完整内容