list + dictionary searching

Manoj sonawane.manoj at gmail.com
Mon Sep 1 06:14:22 EDT 2008


Hello All,

I am very new to python. Any help will be highly appreciated. Thanks

I have a list of dictionaries:

a = [{'username': u'John Wang', 'user_utilization': 1.0, 'month': 9,
'user_id': 4, 'year': 2008}, {'username': u'John Wang',
'user_utilization': 1.0, 'month': 10, 'user_id': 4, 'year': 2008},
{'username': u' ', 'user_utilization': 1.0, 'month': 9, 'user_id': 1,
'year': 2008}]

I would like to :

search dictionaries within this list
create a new list with dictionaries which gives 1 dictionary for every
user with month_year as a key and utilization for that month as a
value

Please give your thoughts

Thanks,
Manoj




More information about the Python-list mailing list