Hello, 

I have a question regarding reshaping numpy array. 

I either have a 1D array that I need to reshape to a 3D array or a 3D array to 
reshape to a 1d numpy array. 

In both of these cases it is assumed that data follows x,y,z ordering.

and I use the following to reshape the numpy array. 


new_1d_array=np.reshape(3d.transpose(),(3d_nx*3d_ny*3d_nz,)) 


new_3d_array=np.reshape(1d,((3d_x,3d_y,3d_z)).transpose())

My question is if there is anyway that reshape would keep x,y,z ordering that 
would not require transpose? and if there is a better more efficient way to do 
this?

Thanks alot, 
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to