Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.093 X-Spam-Evidence: '*H*': 0.82; '*S*': 0.00; 'subject:help': 0.07; 'dict': 0.09; 'result.': 0.15; 'slightly': 0.15; "{'a':": 0.16; 'wrote:': 0.17; 'supposed': 0.21; 'idea': 0.24; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'values': 0.26; 'source': 0.29; 'connection': 0.30; 'anyone': 0.33; 'to:addr :python-list': 0.33; 'hi,': 0.33; 'list': 0.35; 'problem,': 0.35; 'pm,': 0.35; 'similar': 0.35; 'list.': 0.35; 'but': 0.36; 'be.': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'build': 0.39; 'received:192.168': 0.40; 'between': 0.63; 'different': 0.63; 'insight': 0.71; 'received:74.208': 0.71; 'received:74.208.4.194': 0.84; 'subject:comp': 0.96 Date: Thu, 24 Jan 2013 16:08:43 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Dict comp help References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:ZmoCoBvbC0QVX6rDXgPto+mpE0jWLACs7WwE+5QVfyq l0Z+c8phWlEbWVqx/y3//fFnssFBZsfogTqLuNwMCqF1LjE1vz m2IRBOjM6Yek5TsM3dS1TcoIHqwtbXg+Tqgy7mpg3JZgTHCXdX xtolZ202N2VEdGZjpMhb3IeiOQzjDHzGASx4caba+TsYzMiMD1 DaQUQNkMXPJ+iP1P1Ofq9OTcXwLiyQ9cQtNJ5rGDX6tXUNv6CQ kyqj8LTFtulvckkh6P5pvtV7hkTZAVi4qkywtKjUQmkAkj0m3L YLr09L0NC1V97zqhTvz5VvrrQTR8PUtUwWod0xh8/OdotFP6w= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359061763 news.xs4all.nl 6930 [2001:888:2000:d::a6]:44662 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37632 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