Aggregates a MIKE IO 1D result DataFrame with hierarchical columns along specific levels.
Levels are categorized as entity levels, quantity levels, and aggregation levels. Aggregation is only performed along aggregation levels. Quantity levels define the resulting DataFrame’s columns. Entity levels define the resulting DataFrame’s indices.
Parameters
Name
Type
Description
Default
agg
str or callable
Default aggregation function to be applied along DataFrame column levels. Any str or callable accepted by pd.DataFrame.agg may be used. Example: - “max” : Take the maximum value. - “min” : Take the minimum value. - np.mean: Take the mean value. If not specified, then the ‘time’ parameter must be provided and is used as default.
None
override_name
str
Set a custom name for the overall aggregation. By default uses the agg function name.
None
**kwargs
Aggregation functions for specific DataFrame column levels (e.g. time=‘min’, chainage=‘mean’)
{}
Attributes
Name
Type
Description
entity_levels
list of str
The DataFrame column levels used to uniquely identify an entity. (e.g. [‘group’,‘name’,‘tag’]).
quantity_levels
list or str
The DataFrame column levels used to uniquely identify a quantity (e.g. [‘quantity’,‘derived’]).
agg_levels
list of str
The DataFrame column levels that will be aggregated along, in order. (e.g. [‘duplicate’,‘chainage’,‘time’]).
agg_functions
dict of str: callable
A dictionary with keys matching agg_levels, and values being the aggregation functions.
Examples
See which levels will be aggregated, and in what order.