Columns Must Have Unique Names?

I have searched the internet for awhile now and I can’t find an answer. So I apologize if this is an already addressed question, but I cannot find the solution.

I am getting an error when running the following piece of code.

plot_ly(final_df, x=~state, y=~calcval , type=“scatter”)

This is the error:

Error: Columns COUNTY, DISTRICT, STATE must have unique names

I have checked final_df 100x and these columns are not duplicated. What am I missing here?

I think I solved it… I was pulling from a DB and using CAST to reshape the data. Within that CAST it was layering certain variables on top of themselves due to the nature of how it was pulled.