Tour aggregation

This utility is based on the task I have been given while working on South East Wales Transport model. Provided with 37 synthetic travel demand matrices for VISUM model and excel spreadsheet with additional information for each matrix, such as specified mode, trip purpose and tour code it was neccessary to:

  1. Aggregate AM,Inter-Peak,PM, Off-Peak flows into 24 hour flow based on the Tour code (HBEB HBO HBW NHBEB NHBO) and Mode of Travel (Car Passenger, Car driver, Taxi, Bus) with respect to each OD Pair
  2. Union Car mode sub category (Car Passenger, Car driver, Taxi) into one Car mode.
  3. For each Tour Code Generate aggregated 24h flow OD Matrix for Cars
  4. For each Tour Code Generate aggregated 24h flow OD Matrix for Buses
  5. Create sum checks dataframes and export them to excel.

To better understand the problem, I recommend to go through following python code: