Manipulate Pandas Index column on write

See here for the original answer.

According to this thread, the problem can normally be avoided by skipping calling reset_index.

If that doesn't work for you, one alternative solution that was offered is to try the following:

df.to_csv(" file_name.csv ")
df_new = pd.read_csv("file_name.csv").drop(["unnamed 0"], axis=1)

Tags

  1. python (Private)
  2. pandas (Private)
  3. dataframe (Private)
  4. stack-overflow (Private)
  5. answer (Private)