I am using the following code to copy a dataframe into an Excel document:
dfPol.to_excel(writer, 'Influence on Policy', columns=colsPol)
The problem is that I am getting the following error as the URLs are too long:
Ignoring URL .... 255 characters since it exceeds Excel's limit for URLS
So, I found a solution which is to use:
dfPol.to_excel(writer, 'Influence on Policy', columns=colsPol, options={'strings_to_urls': False})
But I am getting an error of:
TypeError: to_excel() got an unexpected keyword argument 'options'
As obviously options does not work with to_excel
, which is what I am using for a lot of other code in my script (i.e. I want to stick with 'to_excel')
Are there any solutions to my problem?
This is not a duplicate of: How to save in *.xlsx long URL in cell using Pandas as that is not about to_excel (it is about excelwriter)