Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: Dict comp help (http://www.velocityreviews.com/forums/t956904-re-dict-comp-help.html)

Dave Angel 01-24-2013 09:08 PM

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57