Oct-12-2019, 06:35 PM
I don't think that's what readlines is giving you. I expect it is giving you ['participant_id;lesson_number;rating', '103;1;2', '103;6;2']. This is a list of strings. This is what you need to do: initialize an empty dictionary. Loop through each string the realines list (except the first one). For each one, pull out the student id, lesson number, and rating; convert them to integers; if the student id isn't in the dictionary add it with seven NAs, then put the rating in for the correct lesson.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures