captest.capdata.CapData.expand_agg_map
- CapData.expand_agg_map(agg_map)
Traverses, expands, and sorts the agg_map.
If a value of agg_map is a dictionary, the items in that dictionary are added to the returned expanded agg_map at the top level. Also, the following steps are completed to aggregate the subgroups: - The column_groups attribute is updated to add a new group with the aggregated columns from the subgroups. - This new group is added to the expanded returned agg_map after the subgroup aggregations. - The resulting aggregation of the subgroups is renamed.
For example, given the following agg_map: ```python agg_map = {
‘irr_ghi’: ‘mean’, ‘irr_poa’: {
‘irr_poa_met1’: ‘mean’, ‘irr_poa_met2’: ‘mean’
},
}
The returned expanded agg_map would be: ```python agg_map = {
‘irr_ghi’: ‘mean’, ‘irr_poa_met1’: ‘mean’, ‘irr_poa_met2’: ‘mean’, ‘irr_poa_aggs’: ‘mean’,
}
and the column_groups attribute would be updated to add the group: ‘irr_poa_aggs’: [‘irr_poa_met1_mean_agg’, ‘irr_poa_met2_mean_agg’]
The column resulting from aggregating the “irr_poa_aggs” group would be “irr_poa_aggs_mean_agg”, which is renamed to “irr_poa_mean_agg”.
- param agg_map:
Dictionary specifying aggregations to be performed on the specified groups from the column_groups attribute.
- type agg_map:
dict
- returns:
agg_map
- rtype:
dict