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


Groups > comp.lang.python > #42812

Trying to understand working with dicts

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <insideshoes@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.087
X-Spam-Evidence '*H*': 0.83; '*S*': 0.00; 'advance': 0.07; '&gt;&gt;': 0.16; 'clear.': 0.16; 'dictionary.': 0.16; 'everyone,': 0.19; 'to:name:python-list@python.org': 0.22; 'print': 0.22; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'url:python': 0.33; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'thanks': 0.36; 'url:org': 0.36; '8bit%:4': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'here': 0.66; 'url:htm': 0.73; 'url:items': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=TTigIrvXBpwMLWVZX0qxullbRb7eEpr41cV7W+VhUw8=; b=iBKHJEIBHmgOysA7IWNkXNKVeVIX3WV6fxfCrpwdrOkWw+LwfpgqjY1Vup8hpKKd+l uNwRKwwEi6U7P1gJHAC/nOiONgdE12K94gtXOl9DgJbj89iCq4kzDph0IavXSRsdhEVP wxn40pHFe9E8URpBkyajjXvriv7bfdAF77zDBe73dafq6QEZBuiNYLCxP+Jtf00wBD85 wtfGq4FcoEEoK/eFavXntg5en1idAKrakpcIVvYZs2gwgqnLRzTuNCHpm55+0cjq73QT /wbABQvop8i8p+1FoZdKaJ9v1F5poF0I4ibqHGtbIfo12cinCqYAXv2lHxbC2mnACxN+ tW5Q==
MIME-Version 1.0
X-Received by 10.50.7.42 with SMTP id g10mr1373854iga.97.1365165243667; Fri, 05 Apr 2013 05:34:03 -0700 (PDT)
Date Fri, 5 Apr 2013 18:04:03 +0530
Subject Trying to understand working with dicts
From inshu chauhan <insideshoes@gmail.com>
To "python-list@python.org" <python-list@python.org>
Content-Type multipart/alternative; boundary=089e0111cf5068b65204d99c4d46
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.136.1365165252.3114.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1365165252 news.xs4all.nl 6928 [2001:888:2000:d::a6]:38323
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:42812

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hello everyone,

Here in my part of the code where cc is a dictionary. I want to understand
what actually cc.iterkeys() and cc[k] actually doing.
I am already reading
http://docs.python.org/2/library/stdtypes.html#dict.items
and http://www.tutorialspoint.com/python/python_dictionary.htm but still
not very clear.

cc = Computesegclass(segimage, refimage)
    for k in sorted(cc.iterkeys()):
        i = argmax(cc[k])
        print >> f, i+1

Thanks in Advance

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


Thread

Trying to understand working with dicts inshu chauhan <insideshoes@gmail.com> - 2013-04-05 18:04 +0530
  Re: Trying to understand working with dicts Peter Pearson <ppearson@nowhere.invalid> - 2013-04-05 16:05 +0000

csiph-web