Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Dict comp help

Reply
Thread Tools

Re: Dict comp help

 
 
Dave Angel
Guest
Posts: n/a
 
      01-24-2013
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
comp.lang.python, comp.sys.ibm.pc.games.rpg, comp.arch.embedded, comp.programming, comp.text.txt vilebuzz@hotmail.com Python 1 10-23-2006 02:47 AM
comp.os.ms-windows.networking.misc,misc.invest.mutual-funds,comp.lang.python,comp.os.magic-cap,comp.sources.games.bugs . Python 0 06-19-2004 08:23 AM
misc.survivalism,comp.text.xml,comp.org.usenix.roomshare,comp.graphics.animation,comp.os.linux.development.system . XML 0 06-19-2004 08:15 AM
comp.lang.c++,comp.dcom.fax,comp.mail.misc,comp.org.usenix,comp.sys.amiga.networking . C++ 0 06-19-2004 07:54 AM
comp.sys.mac.games.misc,comp.sys.ibm.pc.hardware.misc,comp.mail.pegasus-mail.ms-windows,comp.databases.paradox,comp.dcom.sys.cisco . Cisco 0 06-19-2004 07:48 AM



Advertisments