admintest166 发表于 2022-7-6 20:56:26

为什么会一直报 TypeError:“模块”对象不支持项分配

我在测试一个代码时 用pandas 写入东西到xlsx中 但是某个地方一直在报错 请大佬帮忙看下

import pandas as pd

test1=['06/24/2022-02:10:15', '06/24/2022-02:10:15']

pf = pd.DataFrame()
pd['时间'] = test1

save_path = '2.xlsx'
pf.to_excel(save_path, encoding='utf-8', index=False, header=True)

ba21 发表于 2022-7-6 21:09:42

pf['时间'] = test1

临时号 发表于 2022-7-6 21:17:44

import pandas as pd

test1=['06/24/2022-02:10:15', '06/24/2022-02:10:15']

pf = pd.DataFrame()
pf['时间'] = test1

save_path = '2.xlsx'
pf.to_excel(save_path, encoding='utf-8', index=False, header=True)
页: [1]
查看完整版本: 为什么会一直报 TypeError:“模块”对象不支持项分配