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

2012-03-16 Thread Chao YUE
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

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

2012-03-16 Thread Derek Homeier
Dear Chao, 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].