Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29953

Re: A little morning puzzle

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'algorithm': 0.03; 'value,': 0.03; 'sep': 0.09; 'value.': 0.15; '24,': 0.16; 'dictionaries': 0.16; 'keys.': 0.16; 'mon,': 0.16; 'wrote:': 0.17; '(or': 0.18; 'meant': 0.21; 'keys': 0.22; 'produces': 0.22; 'posted': 0.22; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'setting': 0.26; 'values': 0.26; 'message-id:@mail.gmail.com': 0.27; 'rest': 0.28; 'key,': 0.29; 'prints': 0.29; 'no,': 0.29; 'writes': 0.30; 'code': 0.31; 'aside': 0.32; 'values.': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'times.': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'clear': 0.35; 'pm,': 0.35; 'similar': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'created': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'several': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=XI+REaehIhMtn7VnVZWTCFZKtg7sAnBPaLpNBJiws1k=; b=DzvqVI7qLdWzlEo6c5kJH92S7Ye9u0aoMJ+jdSH90L4zrVwDQYb0wquyZlYAPLsXKI 4lhcF0ncjxnQtU6GmTkbhh7aHurB13dEE1Ft3Y575rhEwZbesYWWamG9TcEhEKpOY8mP 8fgMrWjZRCy6HPj+EVLN7c0Lf5TE9iRXx7OnOXeuu+PrgUlAuMtqFiJsu5MPHPgcV2hv 5XZ6qP83rJVZACC0HESiHdBgAOca0bKTBQJsmzttxaIphMtHTVGpeGasE2zwi+JVEHlM 1sbiPDL4Tzf7LGDSzK+DWn8pfsjlSOd9sxgiouacC8J/QxHVnY95U7Xn2NLwx3NVN/UP zELA==
MIME-Version 1.0
In-Reply-To <CA+vVgJXsGE_yLkmNFVNBKZGdZK7cB5FD+j0u6skhxt4UZrJN3A@mail.gmail.com>
References <k3c9jb$2gr$1@ger.gmane.org> <CA+vVgJXh2PyeAT5LdWD6twijHPhmAoL9UPJxj+QJXvmey-WAgQ@mail.gmail.com> <mailman.911.1348056502.27098.python-list@python.org> <evH6s.1159$U54.270@newsfe01.iad> <CA+vVgJVbkYc=O_fhkSNGPKwF80Jg6X7LTOvdQAJ_agoOQbLOVg@mail.gmail.com> <CALwzidn7ztCJup+kPTVwLFFJj-Hxg5EM0PFsryHzca1T9DA9Aw@mail.gmail.com> <5060CE37.8080409@stoneleaf.us> <CA+vVgJXsGE_yLkmNFVNBKZGdZK7cB5FD+j0u6skhxt4UZrJN3A@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Mon, 24 Sep 2012 17:01:04 -0600
Subject Re: A little morning puzzle
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1236.1348527696.27098.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348527696 news.xs4all.nl 6867 [2001:888:2000:d::a6]:58966
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:29953

Show key headers only | View raw


On Mon, Sep 24, 2012 at 4:07 PM, Dwight Hutto <dwightdhutto@gmail.com> wrote:
> They stated:
>
> I have a list of dictionaries.  They all have the same keys.  I want to find the
> set of keys where all the dictionaries have the same values.  Suggestions?
>
> No, to me it meant to find similar values in several dicts with the
> same key, and value. So I created several dicts, and some with the
> same key and value, and showed the matches.

Well, to me at least it is clear that when the OP writes "I want to
find the *set* of *keys*..." (emphasis added), then setting aside the
rest of the problem statement, the result of the algorithm should be a
set (or at least something set-like), and the contents of the set
should be keys.  The posted code produces neither a set nor any keys;
it prints out the same predetermined non-key value multiple times.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: A little morning puzzle Peter Otten <__peter__@web.de> - 2012-09-19 14:09 +0200
  Re: A little morning puzzle Tobiah <toby@tobiah.org> - 2012-09-20 09:28 -0700
    Re: A little morning puzzle Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-22 23:44 -0400
      Re: A little morning puzzle alex23 <wuwei23@gmail.com> - 2012-09-23 20:46 -0700
        Re: A little morning puzzle Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-24 17:22 -0400
        RE: A little morning puzzle "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-09-27 17:58 +0000
    Re: A little morning puzzle Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-23 22:51 -0600
    Re: A little morning puzzle Ethan Furman <ethan@stoneleaf.us> - 2012-09-24 14:18 -0700
    Re: A little morning puzzle Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-24 18:07 -0400
    Re: A little morning puzzle Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-24 17:01 -0600
    Re: A little morning puzzle Dwight Hutto <dwightdhutto@gmail.com> - 2012-09-24 19:13 -0400

csiph-web