This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / ma / core / power

function

numpy.ma.core:power

source: build-install/usr/lib/python3.14/site-packages/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

numpy.power

Aliases

  • numpy.ma.power