怎么样用python将数据帧列写入一个文件

2024-04-26 04:04:19 发布

您现在位置:Python中文网/ 问答频道 /正文

使用pandas模块中的数据帧:

df = dframe.resample('t', how = 'sum')

然后我想把数据写进一个新文件里。我用这个:

with open('dframe.txt', 'w') as fout:
   fout.write(df.price1) #it is the first column

但没用。


Tags: 模块文件数据txtpandasdfaswith

热门问题