[Numpy-discussion] Trim a numpy array in numpy.
Hongchun Jin
hongchunjin@gmail....
Tue Aug 16 16:51:49 CDT 2011
*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-37-48ZD.hdf' ...,
'CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-31T23-56-35ZD.hdf'
'CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-31T23-56-35ZD.hdf'
'CAL_LID_L2_05kmCLay-Prov-V3-01.2008-01-31T23-56-35ZD.hdf']
I need to get the sub-string for date and time, for example,
**
'2008-01-31T23-56-35ZD' in the middle of each element. In more general
cases, the sub-string could be any part of the string in such an array. I
hope to assign the start and stop of the sub-string when I am subsetting it.
*
*Best,
Hongchun
*
On Tue, Aug 16, 2011 at 4:39 PM, Derek Homeier <
derek@astro.physik.uni-goettingen.de> wrote:
> x.astype('|S3')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110816/1b5f8550/attachment.html
More information about the NumPy-Discussion
mailing list