mario.parse_from_excel

mario.parse_from_excel(path: str, table: str, mode: str, data_sheet: str = 0, unit_sheet: str = 'units', calc_all: bool = False, year: Optional[int] = None, name: Optional[str] = None, source: Optional[str] = None, model: str = 'Database', **kwargs)

Parsing database from excel file

Note

  • This function works with a a single excel that contains data & units

  • Please look at the tutorials to understand the format/shape of the data

Parameters
  • path (str) – defined the excel file that contains data & units.

  • table (str) – acceptable options are ‘IOT’ & ‘SUT’

  • mode (str) –

    defined the base matrices to parse. The options are:

    • flows: needs [Z, Y, EY, V, E,] in a singel sheet and unit in another sheet

    • coefficients: needs [z, Y, EY, v, e, units.txt] in a singel sheet and unit in another sheet

  • data_sheet (str, int) – defines the sheet index/name which the data is located(by defualt the first sheet is considered)

  • units_sheet (str,int) – defines the sheet index/name in which the units are located (by default in a sheet named units )

  • calc_all (boolean) – if True, by default will calculate z,v,e,Z,V,E after parsing

  • year (int, Optional) – optional to the Database (just for recoding the metadata)

  • source (str, Optional) – optional to the Database (just for recoding the metadata)

  • name (str, Optional) – optional but suggested. is useful for visualization and metadata.

Returns

Return type

mario.Database