Map multiple lists of values to a list of keys in a python dictionary?
Question: I want to map some values(a list of lists) to some keys(a list) in a python
dictionary. I read [Map two lists into a dictionary in
Python](http://stackoverflow.com/questions/209840/map-two-lists-into-a-
dictionary-in-python)

and figured I could do that this way :

    
    
    headers = ['name', 'surname', 'city']
    values = [
        ['charles', 'rooth', 'kentucky'], 
        ['william', 'jones', 'texas'], 
        ['john', 'frith', 'los angeles']
    ]
    data = []
    
    for entries in values:
        data.append(dict(itertools.izip(headers, entries)))
    

But I was just wondering is there is a nicer way to go?

Thanks

PS: I'm on python 2.6.7


Answer: 
    from functools import partial
    from itertools import izip, imap
    data = map(dict, imap(partial(izip, headers), values))
    

