Error message: Columns must be same length as key

Hi I have a model which I set up in bambi like:

my_model = bambi.Model(“c(cat_1, cat_2, cat_3) ~ some_predictors”, data = my_df, family = “multinomial”)

And I can then sample this and get some posteriors for it. When I load in a very similar dataset (same column names but one or two extra for other purposes, same column types, no nulls in either dataframe) and create the same model with the same code, I get the error above (looking at L132 on the models.py file). Sometimes I get a different error on L147: ValueError: Variable is of an unrecognised type. Ultimately, they are both going back to a pandas issue.

This hasn’t happened to me before, is it a known problem or cause?

I worked it out. My dataframe has two columns of the same name, so bambi gets confused as to which of predictor_1 and predictor_2 it is referring to.

Is it possible for bambi to do a check of this sort of thing before fitting the model and give a controlled explanation (rather than relying on the pandas error message, which isn’t very clear)?