Re: [Tutor] Making a dictionary of dictionaries from csv file

2008-12-03 Thread Rich Lovely
How about this: def recursiveDictFactory(): return defaultdict(recursiveDictFactory) dictOfDictsOfDictsEtc = defaultdict(recursiveDictFactory) --- Richard "Roadie Rich" Lovely Part of the JNP|UK Famille www.theJNP.com (Sent from my iPod - please allow me a few typos: it's a very small key

Re: [Tutor] Making a dictionary of dictionaries from csv file

2008-12-03 Thread Kent Johnson
On Wed, Dec 3, 2008 at 3:34 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > Also you are overwriting the row for each name. So you only > store the last entry. So you need to separate the data further. > Something like > > maindict[row[name]] [row[day]] = (row.weight, row,temp) This will not quite wo

Re: [Tutor] Making a dictionary of dictionaries from csv file

2008-12-03 Thread Alan Gauld
"Judith Flores" <[EMAIL PROTECTED]> wrote I have been trying to create a dictionary of dictionaries (and more dictionaries) from a csv file. Your code below suffers from sloppiness in the number of [] which makes it hard to know exactly what the problem might be. But in principle what you a

[Tutor] Making a dictionary of dictionaries from csv file

2008-12-02 Thread Judith Flores
Dear Python community, I have been trying to create a dictionary of dictionaries (and more dictionaries) from a csv file. The csv file contains longitudinal data corresponding to names. The following is just a very (very) simple example of how the data looks: NameDayweighttemp name114537 na