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


Groups > comp.lang.python > #73441

Re: Understanding Python Code

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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 UNSURE 0.233
X-Spam-Level **
X-Spam-Evidence '*H*': 0.54; '*S*': 0.01; 'subject:Python': 0.06; 'added.': 0.16; 'iteration': 0.16; 'iteration.': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'thu,': 0.19; 'command': 0.22; 'print': 0.22; 'subject:Code': 0.24; 'second': 0.26; 'gets': 0.27; 'header :In-Reply-To:1': 0.27; 'tried': 0.27; 'point': 0.28; 'generally': 0.29; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'calculated': 0.31; 'another': 0.32; 'done.': 0.35; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'building': 0.35; 'like,': 0.36; 'next': 0.36; 'two': 0.37; 'being': 0.38; 'question,': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'most': 0.60; 'new': 0.61; 'kindly': 0.61; 'first': 0.61; 'back': 0.62; 'group,': 0.63; 'dear': 0.65; 'forth': 0.81; 'dict.': 0.84; 'iterative': 0.84; 'results,': 0.84; 'updated,': 0.84; 'esteemed': 0.91; 'states,': 0.91
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=s/EOCvid3z/5ATiJAL2ICuqpiJBGeZU45nepU0WQK3Y=; b=Pk0JO6R1Te2SnxBFzbKfvBB9Tb7v0/bAypuOHDqlL7ICR6B46z1IOJNSAxsBQijJCW mw4N2BONnLN6knVmh7q14aBs3pLCrf5QyPukV2jnPQDXcbT4R8XpSc4uEYoC+6wL955I pOs497wwPnPFHUD9vySHsZfe6qK7jqIkltWGi1uvwzr0YYunrKGzFtSDvegzYTjI8w1t E5zONVfhOw7dsFUeIq2R7C4pXvbnWZGsoBdUEt6NVrS64VNtJMK5askjaBuBgoHM0gsW zMMu51PDtj0eH2KMlw0iBcn/GuNhh7hill+pf9rHI4tfcmuLyVGCOCqIG1o9SMyfZ36D QWaQ==
X-Received by 10.236.42.52 with SMTP id i40mr10350316yhb.119.1403204861476; Thu, 19 Jun 2014 12:07:41 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <2a585d13-cb45-4cf1-b73f-a60c93194343@googlegroups.com>
References <4045d8ca-923d-4384-a684-57cbd80ab7b7@googlegroups.com> <mailman.11118.1403118997.18130.python-list@python.org> <03a82bc4-340f-4b16-8dbb-791b706c7862@googlegroups.com> <mailman.11131.1403161255.18130.python-list@python.org> <f1d47c99-b309-4ecd-8a6b-1f3b25d83370@googlegroups.com> <mailman.11152.1403187031.18130.python-list@python.org> <ddd0c8c7-fb10-4ab3-8a49-3cf321777019@googlegroups.com> <2a585d13-cb45-4cf1-b73f-a60c93194343@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 19 Jun 2014 13:07:01 -0600
Subject Re: Understanding Python Code
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-Mailman-Approved-At Thu, 19 Jun 2014 21:16:14 +0200
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.11157.1403205374.18130.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1403205374 news.xs4all.nl 2900 [2001:888:2000:d::a6]:46027
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:73441

Show key headers only | View raw


On Thu, Jun 19, 2014 at 12:44 PM,  <subhabangalore@gmail.com> wrote:
> Dear Group,
> Generally most of the issues are tackled here, but as I am trying to cross check my understanding I found another question,
>
> f_curr[st] = e[st][x_i] * prev_f_sum
>
> Here, if I give one print command and see the results,
> print "$$2",f_curr
>
> It is showing an iterative update like,
> $$2 {'Healthy': 0.3},
> $$2 {'Healthy': 0.3, 'Fever': 0.04000000000000001}
>
> I was trying to ask how the size is being updated, from 1 to 2 back to 1 again 2... is it for any loop then which one, I tried to change but not being able
> to if any one of the esteemed members may kindly help me.

That statement is inside the for loop that builds the f_curr dict. One
state gets calculated on each iteration. The first time it prints, one
state has been added. The second time it prints, two states have been
added. You only have two states, so at that point the loop is done.
The next time it prints, it's on the next iteration of the outer (i,
x_i) loop and it's building a new f_curr dict. So then you see it
adding one state and then the second state to the new dict. And so on
and so forth until the outer loop completes.

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


Thread

Understanding Python Code subhabangalore@gmail.com - 2014-06-18 09:36 -0700
  Re: Understanding Python Code Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-18 13:15 -0600
    Re: Understanding Python Code subhabangalore@gmail.com - 2014-06-18 22:50 -0700
      Re: Understanding Python Code Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-19 01:00 -0600
        Re: Understanding Python Code subhabangalore@gmail.com - 2014-06-19 02:48 -0700
          Re: Understanding Python Code Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-19 08:09 -0600
            Re: Understanding Python Code subhabangalore@gmail.com - 2014-06-19 07:27 -0700
              Re: Understanding Python Code subhabangalore@gmail.com - 2014-06-19 11:44 -0700
                Re: Understanding Python Code Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-19 13:07 -0600
                Understanding Python Code[Forward_Backward_Wikipedia] subhabangalore@gmail.com - 2014-06-21 15:05 -0700

csiph-web