简体   繁体   English

获得x,y,z,通过3D数据阵列表示

[英]getting x,y,z, mean through a 3D data array

Suppose I have an array which is NxNxN and I want to create an averaged array which stacks each direction. 假设我有一个NxNxN数组,我想创建一个堆叠每个方向的平均数组。 xy (averaged over z), xz (averaged over y), yz (averaged over x) xy(z平均),xz(y平均),yz(x平均)

For xy I would do: 对于xy,我会这样做:

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

Do I simply use axis=1 [or 2 or 3] to stack it in each direction? 我只是使用axis = 1 [或2或3]将它堆叠在每个方向上吗?

If your NxNxN array is a numpy.ndarray : 如果您的NxNxN数组是numpy.ndarray

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 3d将x,y,z坐标转换为3d numpy数组 - 3d coordinates x,y,z to 3d numpy array 通过 3D x,y,z 散布 plot 数据拟合一条线 - Fitting a line through 3D x,y,z scatter plot data 在python中卷积具有三个内核(x,y,z)的3D数组 - Convolve a 3D array with three kernels (x, y, z) in python 如何绘制来自3个不同列表(x,y和z)的3d直方图,其中z是所有重复的x,y坐标的平均值 - How to plot a 3d histogram from 3 different lists (x, y and z), where z is the mean of all repeated x,y coordinates R-通过移除x,y和z维的全零2D矩阵来调整3D数组的大小 - R - Resize a 3D array by removing all-zeros 2D matrices of the x, y, and z dimensions 使用x,y,z顺序将1D numpy数组重塑为3D - Reshape 1D numpy array to 3D with x,y,z ordering 如何围绕x,y和z轴旋转3d数组(nxnxn)x度? - How can I rotate a 3d array (nxnxn) by x degrees around x, y, and z axes? 制作有多少粒子(x、y、z 和时间)通过不同定义的 3D 区域的直方图 - Making a histogram of how many particles (x,y,z, and time) pass through different defined 3D regions 如何从 Plotly 中的 X、Y、Z 数组绘制 3D 表面? - How to plot a 3D surface from X,Y,Z array in Plotly? Python:创建 X、Y 坐标和相应的计算 Z 值的网格以生成 XYZ 的 3D 数组 - Python: Creating a Grid of X,Y coordinates and corresponding calculated Z values to result in a 3D array of XYZ
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM