numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturns
power(x, p)

If x contains negative values, the output is converted to the complex domain.

Parameters

x : array_like

The input value(s).

p : array_like of ints

The power(s) to which x is raised. If x contains multiple values, p has to either be a scalar, or contain the same number of values as x. In the latter case, the result is x[0]**p[0], x[1]**p[1], ... .

Returns

out : ndarray or scalar

The result of x**p . If x and p are scalars, so is :None:None:`out`, otherwise an array is returned.

Return x to the power p, (x**p).

See Also

numpy.power

Examples

>>> np.set_printoptions(precision=4)
>>> np.emath.power([2, 4], 2)
array([ 4, 16])
>>> np.emath.power([2, 4], -2)
array([0.25  ,  0.0625])
>>> np.emath.power([-2, 4], 2)
array([ 4.-0.j, 16.+0.j])
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/scimath.py#432
type: <class 'function'>
Commit: