Save dataframe to file, comma and tab separated

  • Save Dataframe with comma and header, no index
  • Save dataframe with Tab and header , no index

save Dataframe with comma and header, no index

df.to_csv('new_tf_avrg_dec22.csv',  header=True, index=False)
print("done")

Save dataframe with Tab and header , no index

df.to_csv('new_tf_avrg_wiki_dec22.csv', sep='\t', header=True, index=False)

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Rits Blog by Crimson Themes.