#Starter code for Assignment 7 from pylab import * #After some Excel wrangling, we have a csv file that #only contains the EMS records for 9AM to 5PM on weekdays. #The last column contains the elapsed time, in seconds, between #successive calls. We treat the 9 to 5 period as a 'wraparound', so #that if the last call of the day was at 4:58, and the first call of #the next day at 9:01, then we say the elapsed time between the two #is 3 minutes def get_data('ems_call9_to_5.csv'): f=open(filename) listen=[] for line in f: listen.append(line) return listen #return a list of the succssive elapsed times: def get_elapsed_times(u): #strip header: u=u[1:] #strip newline character at end u=[x[:-1] for x in u] #split into the comma separated components u=[x.split(',') for x in u] return [int(x[-1]) for x in u[:-1]]