Re: [Numpy-discussion] indexing of arbitrary axis and arbitrary slice?

2013-03-18 Thread Chao YUE
Hi Nathaniel, thanks for your reply, it works fine and suffice for my purpose. cheers, Chao On Sat, Mar 16, 2013 at 5:49 PM, Nathaniel Smith wrote: > On 16 Mar 2013 16:41, "Chao YUE" wrote: > > > > Dear all, > > > > Is there some way to index the numpy array by specifying arbitrary axis > an

Re: [Numpy-discussion] indexing of arbitrary axis and arbitrary slice?

2013-03-16 Thread Nathaniel Smith
On 16 Mar 2013 16:41, "Chao YUE" wrote: > > Dear all, > > Is there some way to index the numpy array by specifying arbitrary axis and arbitrary slice, while > not knowing the actual shape of the data? > For example, I have a 3-dim data, data.shape = (3,4,5) > Is there a way to retrieve data[:,0,:]

[Numpy-discussion] indexing of arbitrary axis and arbitrary slice?

2013-03-16 Thread Chao YUE
Dear all, Is there some way to index the numpy array by specifying arbitrary axis and arbitrary slice, while not knowing the actual shape of the data? For example, I have a 3-dim data, data.shape = (3,4,5) Is there a way to retrieve data[:,0,:] by using something like np.retrieve_data(data,axis=2,