[SciPy-User] re[SciPy-user] ading time series file using tsfromtxt

Solomon M Negusse solomon.negusse at twdb.state.tx.us
Thu Apr 8 17:49:33 EDT 2010


Hello, 
I'm trying to read a time series of stream discharge using ts.genfromtxt.
The file looks like:

#agency_cd	site_no	datetime	02_00060_00003	02_00060_00003_cd
#5s	15s	16d	14n	10s
agency	  station	  1940-07-01	    1700	A 
agency	  station       1940-07-02	    350   	A

I'm trying to read in the third 'date' column and the 4th  'data' column
using: 

dateconverter = lambda y:
datetime.date(year=int(y.split('-')[0]),month=int(y.split('-')[1]),day=int(y.split('-')[2]))

flowts = ts.tsfromtxt('file', comments='#',datecols=2,
usecols=(2,3),dateconverter=dateconverter,freq='D')

This is returning an error 
Line #25309 (got 3 columns instead of 2). 

I'm fairly new with python and I'm hoping this will be a quick fix for the
experienced users here. I appreciate
any help I can get on this.

Thanks,
Solomon






-- 
View this message in context: http://old.nabble.com/reading-time-series-file-using-tsfromtxt-tp28185028p28185028.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list