I have a list of columns that all have the same name and was wondering how I give each one a distinct title.
df= pd.read_excel('SEO Data 01.15.19.xlsx','Data Dump')
df.columns = df.iloc[0]
df=df.drop(df.index[0])
df.rename(columns={ df.columns[1]: ".1" })
d={'Clicks': ['Clicks1', 'Clicks2', 'Clicks3']}
df.rename(columns=lambda c: d[c].pop(0) if c in d.keys() else c)
I wanted a new table with the new headers but instead I end up with IndexError: pop from empty list