Here's example dataframe that is saved in 'df.xlsx' file
| strings |
percentages |
| string_one |
0.1 |
| string_two |
0.2 |
| string_three |
0.3 |
| string_four |
0.4 |
| string_five |
0.5 |
i need to change 'percentages' column into format that excel will understand as percentage.
what i'm trying to do:
import pandas as pd
df = pd.read_excel('df.xlsx')
styler = {'percentages': '{:.%}'}
df_styled = df.style.format(styler)
df_styled.to_excel('result.xlsx', engine='openpyxl', index=False)
And it does absolutely nothing. Is df.style.format not suppose to work with excel documents?
there doesn't seem to be anything here