Re: [Numpy-discussion] Trim a numpy array in numpy.

2011-08-16 Thread Warren Weckesser
On Tue, Aug 16, 2011 at 4:51 PM, Hongchun Jin wrote: > *Thanks Derek for the quick reply. But **I am sorry, I did not make it > clear in my last email. Assume I have an array like * > * > > ['CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-01T00-37-48ZD.hdf' > > 'CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-

Re: [Numpy-discussion] Trim a numpy array in numpy.

2011-08-16 Thread Derek Homeier
On 16 Aug 2011, at 23:51, Hongchun Jin wrote: > Thanks Derek for the quick reply. But I am sorry, I did not make it clear in > my last email. Assume I have an array like > ['CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-01T00-37-48ZD.hdf' > > 'CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-01T00-37-48ZD.hd

Re: [Numpy-discussion] Trim a numpy array in numpy.

2011-08-16 Thread Hongchun Jin
*Thanks Derek for the quick reply. But **I am sorry, I did not make it clear in my last email. Assume I have an array like * * ['CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-01T00-37-48ZD.hdf' 'CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-01T00-37-48ZD.hdf' 'CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-01T00-

Re: [Numpy-discussion] Trim a numpy array in numpy.

2011-08-16 Thread Derek Homeier
Hi Hongchun, On 16 Aug 2011, at 23:19, Hongchun Jin wrote: > I have a question regarding how to trim a string array in numpy. > > >>> import numpy as np > >>> x = np.array(['aaa.hdf', 'bbb.hdf', 'ccc.hdf', 'ddd.hdf']) > > I expect to trim a certain part of each element in the array, for exampl

[Numpy-discussion] Trim a numpy array in numpy.

2011-08-16 Thread Hongchun Jin
*Hi there, * * * *I have a question regarding how to trim a string array in numpy. * * * *>>> import numpy as np* *>>> x = np.array(['aaa.hdf', 'bbb.hdf', 'ccc.hdf', 'ddd.hdf'])* * * *I expect to trim a certain part of each element in the array, for example '.hdf', giving me ['aaa', 'bbb', 'ccc', '