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

数据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()

 

posted @ 2018-08-15 10:57  ^西江月$  Views(1985)  Comments(0Edit  收藏  举报