Dict comp help

J

Joseph L. Casale

Hi,
Slightly different take on an old problem, I have a list of dicts, I need to build one dict
from this based on two values from each dict in the list. Each of the dictsin the list have
similar key names, but values of course differ.


[{'a': 'xx', 'b': 'yy', 'c': 'zz'},  {'a': 'dd', 'b': 'ee', 'c': 'ff'}]


{ 'xx': 'zz', 'dd': 'ff'}


Anyone have insight on how to pull this off?


Thanks!
jlc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dict comprehension help 0
List comp help 0
Chanelling Guido - dict subclasses 11
set and dict iteration 42
Duplicate keys in dict? 6
opinion: comp lang docs style 10
Python dict as unicode 1
list/tuple/dict question 3

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top