python对csv文件追加写入列,具体内容如下所示:
原始数据
[外链图片转存失败(img-zQSQWAyQ-1563597916666)(C:\Users\innduce\AppData\Roaming\Typora\typora-user-images\1557663419920.png)]
import pandas as pd
import numpy as np
data = pd.read_csv(r'平均值.csv')
print(data.columns)#获取列索引值
data1 = data['flow']#获取列名为flow的数据作为新列的数据
data['cha'
1