handle_dims#

pymc_marketing.prior.handle_dims(x, dims, desired_dims)[source]#

Take a tensor of dims dims and align it to desired_dims.

Doesn’t check for validity of the dims

Examples

1D to 2D with new dim

x = np.array([1, 2, 3])
dims = "channel"

desired_dims = ("channel", "group")

handle_dims(x, dims, desired_dims)