Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

format numbers in column to percentage in python

df['var2'] = pd.Series([round(val, 2) for val in df['var2']], index = df.index)
df['var3'] = pd.Series(["{0:.2f}%".format(val * 100) for val in df['var3']], index = df.index)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #format #numbers #column #percentage #python
ADD COMMENT
Topic
Name
8+9 =