Wednesday, 15 September 2010

python - getting x,y,z, mean through a 3D data array -


Suppose I have an array that is NxNxN and I want to create an average array that piles every direction. Xy (average on average), xz (average on y), yz (average on x)

I do for XI:

  np.mean (data, Axis = 1, dtype = np.float64)   

Do I just use the axis = 1 [or 2 or 3] to pile it in each direction?

If your NxNxN array is a numpy.ndarray :

  xy = NNN means (axis = 2) xz = NNN.mean (axis = 1) yz = NNN.mean (axis = 0)    

No comments:

Post a Comment