Writing dataframe to csv WITHOUT removing commas

前端 未结 3 1708
礼貌的吻别
礼貌的吻别 2021-01-21 05:57

I want to write a pandas dataframe to csv. One of the columns of the df has entries which are lists, e.g. [1, 2], [3, 4], ...

When I use df.to_csv(\'output.csv\') and I

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-21 06:30

    df.to_csv('output.tsv', sep='\t')

    Will separate the values with tabs instead of commas.

    .tsv is tab separated value file

提交回复
热议问题