On Sun, Jul 8, 2012 at 11:47 PM, Fred G bayespoker...@gmail.com wrote:
Hi--
My current input looks like the following:
FILE1.csv
PERSON_IDPERSON_NAME
1 Jen
2 Mike
3 Jim
4
5 Jane
6
Thank you guys so much. I'm quite close now, but I'm having a bit of
trouble on the final for-loop to create the new dictionary. I have the
following 3 functions (note I'm re-typing it from a different computer so
while the identation will be off here, it is correct in the actual code):
#read
Got it! Thanks guys for all your help--what a satisfying feeling! Just out
of curiosity, in the following:
def new_dict (csv_to_dict, nested_line):
old_dict = csv_to_dict(file1)
old_list = nested_line(file2)
new_dict = {}
#for item in old_list:
#new_dict[item] = item
Hi--
My current input looks like the following:
FILE1.csv
PERSON_IDPERSON_NAME
1 Jen
2 Mike
3 Jim
4
5 Jane
6 Joe
7 Jake
FILE2.csv
PERSON_ID PERSON_NAME
I thought it made sense to read the two columns in File1 in as a dictionary
(where the key is actually the name, so that we can search on it later),
and the column of interest in File2 as a list. Finding the common values
then is just:
for item in file2_list:
for line in file1_dict:
if
On 9 July 2012 00:50, Fred G bayespoker...@gmail.com wrote:
I thought it made sense to read the two columns in File1 in as a dictionary
(where the key is actually the name, so that we can search on it later), and
yes...
the column of interest in File2 as a list. Finding the common values