When writing to csv's before using Pandas, I would often use the following format for percentages:
'%0.2f%%' % (x * 100)
This would be processed by Excel correctly when loading the csv.
Now, I'm trying to use Pandas' to_excel function and using
(simulated * 100.).to_excel(writer, 'Simulated', float_format='%0.2f%%')
and getting a "ValueError: invalid literal for float(): 0.0126%". Without the '%%' it writes fine but is not formatted as percent.
Is there a way to write percentages in Pandas' to_excel?
This question is all pretty old at this point. For better solutions check out xlsxwriter working with pandas.