MMMIDataWrapper.get_avg_cost_per_unit#
- MMMIDataWrapper.get_avg_cost_per_unit()[source]#
Get the weighted-average cost per unit for each channel.
Computed as
channel_spend.sum("date") / channel_data.sum("date"). Returns 1.0 (as a broadcast-compatible DataArray) ifchannel_spendis not available, making this backward compatible.- Returns:
xr.DataArrayAverage cost per unit with dims (channel,) [+ custom dims].