MatrixReport#
- class caf.toolkit.pandas_utils.MatrixReport(matrix, translation_vector)[source]#
Creates a high level summary of a matrix and its trip ends.
- Parameters:
matrix (pd.DataFrame) – The matrix to be summarised.
translation (translation.ZoneCorrespondence) – A translation object to be applied to the matrix,.
translation_vector (translation.ZoneCorrespondence)
See also
Attributes
The column sums of the matrix.
High level statistics on the original and, if provided, sectorised matrix.
Distribution if trip_length_distribution has been called, otherwise none.
Matrix in the original zoning system.
The row sums of the matrix.
Sector matrix if translation vector provided, otherwise none.
The row and column sums of the matrix.
Vehicle kms if calc_vehicle_kms has been called, otherwise none.
Methods
__init__(matrix, translation_vector)abs_difference(other)Calculate the absolute difference between to matrices and sectorise output.
calc_vehicle_kms(cost_matrix, *[, ...])Calculate vehicle kms from the matrix passed on initialisation.
from_file(path, *, translation_path[, ...])Create an instance of MatrixReport from file paths.
trip_length_distribution(cost_matrix, bins, *)Calculate a distribution from the matrix passed on initialisation.
write_to_excel(writer[, label, ...])Write the report to an Excel file.
Attributes Documentation
- column_sum#
The column sums of the matrix.
- describe#
High level statistics on the original and, if provided, sectorised matrix.
- distribution#
Distribution if trip_length_distribution has been called, otherwise none.
- matrix#
Matrix in the original zoning system.
- row_sum#
The row sums of the matrix.
- sector_matrix#
Sector matrix if translation vector provided, otherwise none.
- trip_ends#
The row and column sums of the matrix.
- vkms#
Vehicle kms if calc_vehicle_kms has been called, otherwise none.