Relatively new to python, I'm trying to use pandas sort_values() to sort my df by a specific column. But I'm getting an error about multiindexing, but I don't think I've created a multiindex have I? Here is the data I'm practicing with. I want to see all data organized by "diggies" in ascending.
df
letters digits diggies
0 A 1 7
1 B 2 3
2 C 3 20
df.sort_values(by="diggies") ValueError: Cannot sort by column diggies in a multi-index you need to explicitly provide all the levels
Have I unintentionally created a multiindex? Interestingly, I was able to run sort from another practice data set I imported from a CSV. I though the difference might ahve been the data types, but they are both combinations of either "objects" or "int64".
Any tips on why I'm getting this error and how to get around it? Thanks
***added info
MultiIndex(levels=[['digits', 'letters', 'diggies']], labels=[[1, 0, 2]])