I have a csv file with contents in the following format:
CSE110, Mon, 1:00 PM, Fri, 1:00 PM
CSE114, Mon, 8:00 AM, Wed, 8:00 AM, Fri, 8:00 AM
which is basically course name followed by it's timings.
what's the best data structure to parse and store this data?
I tried using named tuples as follows:
CourseTimes = namedtuple('CourseTimes', 'course_name, day, start_time ')
But a single course can be scheduled on multiple days and time as shown for cse114 above. This can only be decided at run-time. How to handle this?
or else, Can I make use of Dictionary or List?
I am trying to solve a scheduling problem to assign TAs to courses. I might have to compare times to check for any collisions in the future
Also to complicate things up, the input file has other data as well which I need to parse. Basically the following is the format.
//Course times
CSE110, Mon, 1:00 PM, Fri, 1:00 PM
CSE114, Mon, 8:00 AM, Wed, 8:00 AM, Fri, 8:00 AM
....
//Course recitation times
CSE306, Mon, 2:30 PM
CSE307, Fri, 4:00 PM
...
//class strength
CSE101, 44, yes
CSE101, 115, yes
...
I need store all this in separate data structures I suppose. What could be the right reg-ex patterns for each of the category?