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

Julian Taylor jtaylor.debian at googlemail.com
Wed Aug 27 11:16:19 EDT 2014


On 27.08.2014 17:08, phinn stuart wrote:
> Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy array into
> (480L, 1440L)?
> 
> Thanks in the advance.

np.squeeze removes empty dimensions:

In [2]: np.squeeze(np.ones((1,23,232))).shape
Out[2]: (23, 232)




More information about the NumPy-Discussion mailing list