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

Pierre GM pgmdevlist at gmail.com
Thu Jan 14 14:53:33 EST 2010


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)]


More information about the SciPy-User mailing list