Namedtuples problem

Deborah Swanson python at deborahswanson.net
Thu Feb 23 20:41:03 EST 2017


Irv Kalb wrote, on February 23, 2017 3:51 PM
> 
> > On Feb 23, 2017, at 3:00 PM, Deborah Swanson 
> > <python at deborahswanson.net 
> <mailto:python at deborahswanson.net>> wrote:
> > 
> > The weirdness is that
> > 
> > group[0][4]
> > 
> > gets the right answer, but
> > 
> > group[[idx][records_idx[label]]],
> > where idx = 0 and records_idx[label]] = 4
> 
> 
> If that's the case, then I think you need this instead:
> 
> group[idx][records_idx[label]]
> 
> Irv

Yes, that's exactly right and it works in my running code. Three of you
have now spotted the problem (and explained it in terms I can
recognize). Thank you all!




More information about the Python-list mailing list