bundles / numpy 2.4.3 / numpy / ma / core / power
function
numpy.ma.core:power
source: /numpy/ma/core.py :7118
Signature
def power ( a , b , third = None ) Summary
Returns element-wise base array raised to power from second array.
Extended Summary
This is the masked array version of numpy.power. For details see numpy.power.
Notes
The out argument to numpy.power is not supported, third has to be None.
Examples
import numpy as np import numpy.ma as ma x = [11.2, -3.973, 0.801, -1.41] mask = [0, 0, 0, 1] masked_x = ma.masked_array(x, mask) masked_x ma.power(masked_x, 2) y = [-0.5, 2, 0, 17] masked_y = ma.masked_array(y, mask) masked_y ma.power(masked_x, masked_y)
See also
Aliases
-
numpy.ma.power