![]() |
Re: Dict comp help
On 01/24/2013 03:58 PM, Joseph L. Casale wrote:
> 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 dicts in 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? > Not till you tell us what the pattern is supposed to be. I can see how you might want xx:dd, yy:ee, zz:ff but have no idea what the intended connection is between the source dicts and the result. -- DaveA |
| All times are GMT. The time now is 08:57 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.