[Numpy-discussion] remove redundant dimension in a ndarray?

Chao YUE chaoyuejoy@gmail....
Fri Mar 16 12:57:33 CDT 2012

Dear all,

Do we have a function in numpy that can automatically "shrink" a ndarray
with redundant dimension?

like I have a ndarray with shape of (13,1,1,160,1), now I have written a
small function to change the array to dimension of (13,160) [reduce the
extra dimension with length as 1].
but I just would like to know maybe there is already something which can do
this there ?



Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120316/03b570d4/attachment.html 

More information about the NumPy-Discussion mailing list