mario.Database.aggregate

Database.aggregate(io, drop=['unused'], levels='all', backup=True, calc_all=True, ignore_nan=False, inplace=True)
This function is in charge of reading data regarding the aggregation

of different levels and aggregate data.

Parameters:
  • io (str, Dict[pd.DataFrame]) –

    1. in case that the data should be given through an Excel file, represents the path of the Excel file

    2. in case that the data needs to be given by DataFrame, a dictionary of DataFrames can be give in which the keys are the name of the levels and values are the DataFrames

  • drop (str, List[str]) – representing the items/items that should be droped (only allowed for E and EY matrix)

  • levels (str, List[str]) –

    1. in case that a single level or ‘all’ levels should be aggregated, str can be used

    2. in case that multiple levels should be aggregated, a list of levels should be used

  • backup (boolean) – shows if the user needs to make a backup before aggregating so can reset to previous case.

  • calc_all (boolean) – if True, [‘v’,’z’,’e’] will be calculated automatically after the aggregation of flows

  • ignore_nan (booelan) –

    1. if False, will stop the code if finds some nan values in the aggregation dataframes

    2. if True, will ignore the NaNs and do not aggregated the specific items with NaN values

  • inplace (booelan) – if True will aggrgate the datbase object itself otherwise will return the aggregated object as a new database object

Returns:

  • mario.Database – if inplace = False returns a new mario.Database

  • None – if inplace = True implents the changes in place