Suppose I have an array which is NxNxN and I want to create an averaged array which stacks each direction. x-y (averaged over z), x-z (averaged over y), y-z (averaged over x)
For x-y I would do:
np.mean(data,axis=1, dtype=np.float64)
Do I simply use axis=1 [or 2 or 3] to stack it in each direction?
If your NxNxN array is a numpy.ndarray
:
xy = NNN.mean(axis=2)
xz = NNN.mean(axis=1)
yz = NNN.mean(axis=0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With