[Numpy-discussion] indexing question

Alan G Isaac aisaac@american....
Tue Mar 30 09:24:56 CDT 2010


On 3/30/2010 10:13 AM, Tom K. wrote:
> What I want to do is get rid of singleton dimensions, and index into the
> last dimension with an array.

>>> x=np.zeros((10,1,1,1,14,1024))
>>> np.squeeze(x).shape
(10, 14, 1024)

hth,
Alan Isaac


More information about the NumPy-Discussion mailing list