Model database utilities

Common code for data input.


Convert a dict of dataframes to a single pd.DataFrame.

The keys of dataframes are saved in a new column ‘version’.


Return a sorted list of non-index columns in pandas.Dataframe df.

item.model.common.drop_empty(df, columns=None)[source]

Drop rows in df where the data columns are all empty.

The number of dropped rows is logged. If columns, an iterable of column names, is given, drop on these columns instead.


Load model & scenario data., *args, **kwargs)[source]

Select from data.

item.model.common.to_wide(data, dimension='year')[source]

Convert data to wide format, one column per year.