[SciPy-User] Timseries ts.tofile() Remove brackets.

Dharhas Pothina Dharhas.Pothina at twdb.state.tx.us
Thu Jan 14 15:21:51 EST 2010


Thanks, I created a ticket.

- d

>>> Pierre GM <pgmdevlist at gmail.com> 1/14/2010 1:53 PM >>>
On Jan 14, 2010, at 10:26 AM, Dharhas Pothina wrote:
> Hi,
> 
> I'm trying to format the output of ts.tofile() and I can't find anyway to suppress the use of open and close brackets on each line. ie using 
> ...
> anyway of doing this without reopening the file and removing the brackets.



Fixing the code :)
Could you file a ticket ? Thanks a lot in advance.
But here's a workaround

>>>  _tmp=ts.time_series([('AAA',1,1.),('BBB',1,2.)],dtype=[('a','|S3'),('b',int),('c',float)],start_date=ts.now('D'))
>>>  [tuple([d]+list(s)) for (d,s) in zip(_tmp.dates,_tmp.series)]
(<D : 14-Jan-2010>, 'AAA', 1, 1.0), (<D : 15-Jan-2010>, 'BBB', 1, 2.0)]
_______________________________________________
SciPy-User mailing list
SciPy-User at scipy.org 
http://mail.scipy.org/mailman/listinfo/scipy-user




More information about the SciPy-User mailing list