MatrixReport#

class caf.van.matrix_validation.MatrixReport(matrix, translation=None, translation_from_col=None, translation_to_col=None, translation_factors_col=None)[source]#

Produce report of statistics for a given matrix.

Parameters:
  • matrix (pd.DataFrame) – 2D matrix with columns and index containing zones.

  • translation (pd.DataFrame, optional) – Factors for translating matrix from current zone system to a new one for reporting, if not given then the matrix zone system remains unchanged. If this is given then all column name parameters must also be given.

  • translation_from_col (str, optional) – Column name in translation containing current matrix zones.

  • translation_to_col (str, optional) – Column name in translation containing output matrix zones.

  • translation_factors_col (str, optional) – Column name in translation containing translation factors.

Raises:

ValueError – If translation is given without the column names, or visa versa.

See also

matrix_describe

for producing descriptive statistics of a matrix.

Attributes

column_sum

The column sums of the matrix.

row_sum

The row sums of the matrix.

trip_ends

Matrix trip ends, with columns "row_sums" and "col_sums".

Methods

__init__(matrix[, translation, ...])

from_file(path[, translation_path, ...])

Create an instance of MatrixReport from file paths.

write_to_excel(writer[, label, output_matrix])

Write matrix report to multiple sheets in an Excel file.

Attributes Documentation

column_sum#

The column sums of the matrix.

row_sum#

The row sums of the matrix.

trip_ends#

Matrix trip ends, with columns “row_sums” and “col_sums”.