[Chicago] 2 unique keys in a python dict?

Lukasz Szybalski szybalski at gmail.com
Thu Oct 9 19:21:49 CEST 2008


On Thu, Oct 9, 2008 at 11:53 AM, John Hunter <jdh2358 at gmail.com> wrote:
> On Thu, Oct 9, 2008 at 11:19 AM, Massimo Di Pierro
> <mdipierro at cs.depaul.edu> wrote:
>
>>>>> rows=db().select(db.mytable.ttid,db.mytable.paid.sum(),orderby=db.mytable.ttid,groupby=db.mytable.ttid)
>>>>> for row in rows:
>> ... print 'transaction',row.ttid,'total amount',row[db.mytable.paid.sum()]
>
> Or use matplotlib's support for CSV files via numpy record arrays
>
>  import matplotlib.mlab as mlab
>  r = mlab.csv2rec('myfile.csv')
>  print r.paid.sum()
>
> csv2rec does type inference from the data in the file, and numpy
> arrays support all the standard math and stat operations (mean, std,
> logical masks, etc...)

This is a combination of sqlserver2000, clarion tps files via odbc,
mysql server, all with different fields structure that at the end need
to show up on the excel.

Wish there was an easier way of merging these sources into some csv
based reporting tool, getting the proper totals, and output final csv
file in under 2 weeks.

Lucas


More information about the Chicago mailing list