Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

format numbers in dataframe pandas

df.loc[:, "Population"] = df["Population"].map('{:,d}'.format)
df.loc[:, "PercentageVaccinated"] = df["PercentageVaccinated"].map('{:.2f}'.format)
Source by www.markhneedham.com #
 
PREVIOUS NEXT
Tagged: #format #numbers #dataframe #pandas
ADD COMMENT
Topic
Name
4+5 =