当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Pandas overwriting columns with to_csv

问题描述:

I have two data frames: Position and Force. I would like to write Position to the first column, Force to the next, and then repeat the process for each iteration (the file path changes each time the function is called). Right now, I have :

Position.to_csv("filepath")

Force.to_csv("filepath")

Right now, the force dataframe seems to overwrite Position- I end up with a csv file with one column, the latest Force data frame. Is there a way to get to_csv to add a column instead of just write to the first one?

Thanks!

分享给朋友:
您可能感兴趣的文章:
随机阅读: