On 02/23/2013 09:40 PM, Matthew Johnson wrote:
For the sake of those who finds this thread -- the date / value pairs
can be printed by the following:

import fred

fred.key(fredKey)

gnpObvs = fred.observations('GNPCA')

for i in range(1, len(gnpObvs['observations']['observation'])):
     print gnpObvs['observations']['observation'][i]['date'],
gnpObvs['observations']['observation'][i]['value']

mj


So it's returning a dict of dicts of lists of dicts?

Perhaps this loop would read better (untested):

for  item in gnpObvs['observations']['observation']:
    print item['date'], item['value']





--
DaveA
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to