[Numpy-discussion] Convert 3d NumPy array into 2d

Sebastian Berg sebastian at sipsolutions.net
Wed Aug 27 11:16:35 EDT 2014


On Do, 2014-08-28 at 00:08 +0900, phinn stuart wrote:
> Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy array
> into (480L, 1440L)?
> 

Just slice it arr[0, ...] will do the trick. If you are daring,
np.squeeze also works, or of course np.reshape.

- Sebastian

> 
> Thanks in the advance.
> 
> phinn
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion





More information about the NumPy-Discussion mailing list