Re: Understanding Python Code

2014-06-19 Thread Ian Kelly
On Thu, Jun 19, 2014 at 12:44 PM, 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"

Re: Understanding Python Code

2014-06-19 Thread subhabangalore
On Thursday, June 19, 2014 7:57:38 PM UTC+5:30, wrote: > On Thursday, June 19, 2014 7:39:42 PM UTC+5:30, Ian wrote: > > > On Thu, Jun 19, 2014 at 3:48 AM, wrote: > > > > > > > I am trying to see this line, > > > > > > > prev_f_sum = sum(f_prev[k]*a[k][st] for k in states) > > > > > > > >

Re: Understanding Python Code

2014-06-19 Thread subhabangalore
On Thursday, June 19, 2014 7:39:42 PM UTC+5:30, Ian wrote: > On Thu, Jun 19, 2014 at 3:48 AM, wrote: > > > I am trying to see this line, > > > prev_f_sum = sum(f_prev[k]*a[k][st] for k in states) > > > > > > a[k][st], and f_prev[k] I could take out and understood. > > > Now as it is doing sum(

Re: Understanding Python Code

2014-06-19 Thread Ian Kelly
On Thu, Jun 19, 2014 at 3:48 AM, wrote: > I am trying to see this line, > prev_f_sum = sum(f_prev[k]*a[k][st] for k in states) > > a[k][st], and f_prev[k] I could take out and understood. > Now as it is doing sum() so it must be over a list, > I am trying to understand the number of entities in t

Re: Understanding Python Code

2014-06-19 Thread subhabangalore
On Thursday, June 19, 2014 12:30:12 PM UTC+5:30, Ian wrote: > On Wed, Jun 18, 2014 at 11:50 PM, wrote: > > > Thank you for the reply. But as I checked it again I found, > > > f_prev[k] is giving values of f_curr[st] = e[st][x_i] * prev_f_sum > > > which is calculated later and again uses prev_

Re: Understanding Python Code

2014-06-19 Thread Ian Kelly
On Wed, Jun 18, 2014 at 11:50 PM, wrote: > Thank you for the reply. But as I checked it again I found, > f_prev[k] is giving values of f_curr[st] = e[st][x_i] * prev_f_sum > which is calculated later and again uses prev_f_sum. f_prev is the f_curr that was calculated on the previous iteration of

Re: Understanding Python Code

2014-06-18 Thread subhabangalore
On Thursday, June 19, 2014 12:45:49 AM UTC+5:30, Ian wrote: > > > > The questions are, > > > i) prev_f_sum = sum(f_prev[k]*a[k][st] for k in states) > > > here f_prev is called, > > > f_prev is assigned to f_curr ["f_prev = f_curr"] > > > f_curr[st] is again being calculated as, ["f_curr[st

Re: Understanding Python Code

2014-06-18 Thread Ian Kelly
On Wed, Jun 18, 2014 at 10:36 AM, wrote: > The questions are, > i) prev_f_sum = sum(f_prev[k]*a[k][st] for k in states) > here f_prev is called, > f_prev is assigned to f_curr ["f_prev = f_curr"] > f_curr[st] is again being calculated as, ["f_curr[st] = e[st][x_i] * > prev_f_sum"] which again