[SciPy-User] timeseries tsfromtxt missing_values bug?

Dharhas Pothina Dharhas.Pothina@twdb.state.tx...
Fri Jan 15 14:11:49 CST 2010


Hi,

I'm having issues with tsfromtxt masking fields using the missing_values parameter.

>>> dateconverter = lambda y, m, d, hh, mm : datetime(year=int(y), month=int(m), day=int(d), hour=int(hh), minute=int(mm))
>>> rseries = ts.tsfromtxt('test.csv',freq='T',comments='#',dateconverter=dateconverter,datecols=(1,2,3,4,5),usecols=(1,2,3,4,5,8),delimiter=',',missing_values=-999.0)

gives :

timeseries([(-999.0,) (-999.0,) (-999.0,)],
   dtype = [('f5', '<f8')],
   dates = [02-May-2000 06:00 12-May-2000 08:00 13-May-2000 00:00],
   freq  = T)

While :

>>> rseries = ts.tsfromtxt('test.csv',freq='T',comments='#',dateconverter=dateconverter,datecols=(1,2,3,4,5),usecols=(1,2,3,4,5,8),delimiter=',',missing_values=-999.0,names='data')

gives :

timeseries([(--,) (--,) (--,)],
   dtype = [('_tmp4', '<f8')],
   dates = [02-May-2000 06:00 12-May-2000 08:00 13-May-2000 00:00],
   freq  = T)

So if I uses the 'names' argument the missing values are masked  correctly but the field name is set to '_tmp4' rather than 'data'. If I don't use the 'names' argument the missing values are not masked. I've attached a small file to demonstrate. Am I doing something wrong or is this a bug.

- dharhas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.csv
Type: application/vnd.ms-excel
Size: 1588 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20100115/cf417c8d/attachment.xlb 


More information about the SciPy-User mailing list