Error: UserWarning: Ignoring URL... 已解决

时间:2022-07-12 13:15:25

数据data里存有url,用pandas的to_excel() 报错:UserWarning: Ignoring URL...

解决方案:

data.to_excel("data.xlsx")

改为:

writer = pd.ExcelWriter('data.xlsx',
engine='xlsxwriter',
options={'strings_to_urls': False}) data.to_excel(writer, sheet_name='Sheet1')
writer.save()