I am trying to convert a pandas dataframe column of floats to percentage style
C
0.9977
0.1234
1.000
..
to
C
99.77%
12.34%
100%
...
To do this, I am doing:
df['C'] = df['C'].map(lambda n: '{:.2%}'.format(n))
but I am getting the following error:
ValueError: Unknown format code '%' for object of type 'str'
I also tried '{:,.2%}' with the same error...
What I am doing wrong?