aggregate_idata_dims#
- pymc_marketing.data.idata.utils.aggregate_idata_dims(idata, dim, values, new_label, method='sum')[source]#
Aggregate multiple dimension values into one.
- Parameters:
- Returns:
az.InferenceDataNew InferenceData with aggregated dimension values
- Raises:
ValueErrorIf the dimension doesn’t exist in any group, or if new_label conflicts with existing coordinate values that aren’t being aggregated
Examples
>>> # Combine social channels into one >>> combined = aggregate_idata_dims( ... idata, ... dim="channel", ... values=["Facebook", "Instagram", "TikTok"], ... new_label="Social", ... method="sum", ... )