Currently attempting to round a specific column on my DataFrame, column is float64 Dtype, but keeps returning the column with all the decimal places
#The conversion from objects to float
covid2=covid.fillna(1)
covid2.replace(',','', regex=True, inplace=True)
covid2['Population'] = covid2['Population'].astype(float, errors = 'raise')
covid2['Total Deaths'] = covid2['Total Deaths'].astype(float, errors = 'raise')
#Average column
covid2['Average']=covid2['Population']/covid2["Total Deaths"]*1000
#Rounding attempt
decimals = 5
covid2['Average'] = covid2['Average'].apply(lambda x: round(x, decimals))
covid2.head()
RESULT:
0 2.955203e+05
1 2.650322e+06
2 3.993382e+05
3 5.062042e+05
4 3.089394e+05