append content to file
import numpy as np
acc_list=np.array([0.97,0.92,0.93,0.89])
# 注意这个地方添加文件不需要特别声明是什么文件
file = open("result.csv", "a+")
print("{:.2f}, {:.2f}".format(acc_list.mean(), acc_list.std()), file=file)
print("{:.2f}, {:.2f}".format(1.2323, 2.233424), file=file)
file.close()
read data from file
import pandas as pd
data = pd.read_csv("./result.csv",header=None)
data
import pandas as pd
data = pd.read_csv("./result.csv",header=0)
data