You either need to set index=True
:
df.to_csv('res.csv', index=True, header=True)
or you can reset the index before saving using:
df.reset_index().to_csv('res.csv', index=None, header=True)
CLICK HERE to find out more related problems solutions.