代码:
def print_data(data, dataframe):
print('%3d | %s | %s, %s, %s, %s, %s'
% (len(dataframe), data['Symbol'],
pd.to_datetime(int(data['Updated']), unit='ms'),
data['Rates'][0], data['Rates'][1], data['Rates'][2],
data['Rates'][3]))
代码输出:
8 | EUR/USD | 2019-05-22 14:03:21.475000, 1.1162, 1.11632, 1.11809, 1.11481
我想将此输出保存到一个csv文件中
答案 0 :(得分:2)
data.to_csv("data.csv", sep = ",")