CUBEMatConverter.from_csv#
- CUBEMatConverter.from_csv(num_zones, csv_paths, mat_path, mat_factor=1)[source]#
Convert CSVs to CUBE’s .mat format.
CSVs should have 3 columns: origin, destination and trips, with no header row.
- Parameters:
num_zones (int) – Number of zones in the matrix.
csv_paths (dict[str, Path]) – Paths to the CSVs to be used for creating the matrix, the CSVs should have 3 columns: origin, destination and trips with no header row. The dictionary keys provide the name for the matrix level in the output file.
mat_path (Path) – Output CUBE .mat file to create.
mat_factor (float, default) – Factor to divide matrix by upon creation.
- Returns:
CUBE matrix created.
- Return type:
- Raises:
FileNotFoundError – If any of the input CSVs don’t exist.
CUBEMatConverterError – If the process fails creating the CUBE matrix.