[Numpy-discussion] indexing question

Alan G Isaac aisaac at american.edu
Tue Mar 30 10:24:56 EDT 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)

Alan Isaac

More information about the NumPy-Discussion mailing list