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: 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; '>>': 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 To: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 --089e0111cf5068b65204d99c4d46 Content-Type: text/plain; charset=ISO-8859-1 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 --089e0111cf5068b65204d99c4d46 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello everyone,=A0

Here in my par= t of the code where cc is a dictionary. I want to understand what actually = cc.iterkeys() and cc[k] actually doing.=A0
and=A0http://www.tutorialspoint.com/python/python_dictionary.htm= =A0but still not very clear.=A0

cc =3D Compu= tesegclass(segimage, refimage)=A0
=A0 =A0 for k in sorted(cc.iterkeys()):
=A0 =A0 =A0 =A0 i = =3D argmax(cc[k])
=A0 =A0 =A0 =A0 print >> f, i+1

Thanks in Advance=A0
=A0
--089e0111cf5068b65204d99c4d46--