1.读txt(numpy)
a = np.genfromtxt('path', skip_header=19)
2.写txt(numpy)
np.savetxt('path',a)
3.读csv(pandas)
a = pd.read_csv('path')
4.写csv(numpy)
np.savetxt('path',a)
5.读excel(pandas)
a = pd.read_excel('path')
6.写excel(pandas)
data = pd.DataFrame(array) # 数组转pandas.DataFrame(二维表)格式
writer = pd.ExcelWriter('path') # 写入Excel文件
data.to_excel(writer, 'sheet1', float_format='%.5f') # sheet1是写入excel的sheet名
writer.save()