Merge CSVs in Python with different columns

后端 未结 4 871
栀梦
栀梦 2021-02-05 18:47

I have hundreds of large CSV files that I would like to merge into one. However, not all CSV files contain all columns. Therefore, I need to merge files based on column name, no

4条回答
  •  感情败类
    2021-02-05 19:34

    For those of us using 2.7, this adds an extra linefeed between records in "out.csv". To resolve this, just change the file mode from "w" to "wb".

提交回复
热议问题