Using namedtuples field names for column indices in a list of lists

Deborah Swanson python at deborahswanson.net
Tue Jan 10 02:14:16 EST 2017


Ethan Furman wrote, on January 09, 2017 10:06 PM
> 
> On 01/09/2017 08:51 PM, Deborah Swanson wrote:
> > Ethan Furman wrote, on January 09, 2017 8:01 PM
> 
> >> As I said earlier, I admire your persistence -- but take some time 
> >> and learn the basic vocabulary as that will make it much easier for

> >> you to ask questions, and for us to give you meaningful answers.
> >
> > As I mentioned, I have completed MIT's 2 introductory Python courses

> > with final grades of 98% and 97%.  What tutorials do you think would

> > significantly add to that introduction?
> 
> The Python version of "Think like a computer scientist" is 
> good.  Otherwise, ask the list for recommendations.  I'm not 
> suggesting more advanced topics, but rather basic topics such 
> as how the REPL works, how to tell what objects you have, how 
> to find the methods those objects have, etc.

I'm working on all of that, and I've been taking physics, chem, computer
science and theoretical mathematics (straight 4.0s my last 2 years,
graduated summa cum laude), but it's been a couple of decades since my
last brick building university course. It's coming back fast, but
there's a lot I'm still pulling out of cobwebs. I basically know the
tools to use for the things you mention, but in the online coursework
I've done in the past year, we didn't need to use them because they told
us everything. So that's another thing I'm doing catch up on. Really
shouldn't take too long, it's not that complicated or difficult.

> > It's true that I didn't spend much time in the forums while I was 
> > taking those courses, so this is the first time I've talked with 
> > people about Python this intensively. But I'm a good learner and I'm

> > picking up a lot of it pretty quickly. People on the list also talk 
> > and comprehend differently than people in the MIT courses did, so I 
> > have to become accustomed to this as well. And the only place to
learn 
> > that is right here.
> 
> Indeed.
> 
> The issue I (and others) see, though, is more along the lines 
> of basic understanding: you seemed to think that a list of 
> lists should act the same as a list of tuples, even though 
> lists and tuples are not the same thing.  It's like expecting 
> a basket of oranges to behave like a basket of avocados. ;)
> 
> As you say, you're making good progress.
> 
> --
> ~Ethan~

I'm sorry, I didn't think a list of namedtuples would be like a list of
lists when I wrote to Erik just a bit ago today, but I sort of did when
I first started trying to use them a couple days ago. And to the extent
I was pretty sure they weren't the same, I still didn't know in what
ways they were different. So when people ask me questions about why I
did things the way I did, I try to explain that I didn't know certain
things then, but I know them now. I'm guessing that you (and those who
see things like you do) might not be used to working with quick learners
who make mistakes at first but catch up with them real fast, or you're
very judgemental about people who make mistakes, period. I certainly
don't care if you want to judge me, you're entitled to your opinion. One
of my MIT professors was always screwing up little things, even things
he knew inside out. Some people are like that, and I think I might be
one of them, although I'm really not as bad as he was.

So I guess you should just do your thing and I'll do mine. I don't
promise that I'll ever get to the point where I never set a foot wrong.
I know some people can do that, and I hope someday I will. But then I
remember the MIT professor, who I really learned a lot from, despite all
his flub-ups, and that I might be a little bit like him. Takes all
kinds, and I think in the end what will count is the quality of my
finished work (which has always been excellent), and not the messy
process to get there.

It shocked me the first time someone on this list jumped down my throat
for a momentary lapse on my part, as if I was a total idiot and knew
nothing, but I'm sort of getting used to that too. It must be nice to be
so perfect, I guess.

Deborah




More information about the Python-list mailing list