Lets say I have a DataFrame with columns with the same name:
x x y
2 5 1
1 9 3
4 1 2
Is there built-in general function to rename columns with the same name to differ from each other? Example of a possible result:
x0 x1 y
2 5 1
1 9 3
4 1 2
When reading a csv with pandas.read_csv automatically does this (defaulting mangle_dupe_cols=True) but I could not find a handy way to do this to a DataFrame object already in Python.