if you do df=df.set_index(df.col1) then you have an index of col1 and a column col1 which is still a valid pandas dataframe.
Range("A1").value = df now fails with "cannot insert col1 already exists as it resets the index before writing. Would be better to output index then columns rather than failing.
if you do
df=df.set_index(df.col1)then you have an index of col1 and a column col1 which is still a valid pandas dataframe.Range("A1").value = dfnow fails with "cannot insert col1 already exists as it resets the index before writing. Would be better to output index then columns rather than failing.