0
How I can parse to float the string data of a specific column in a dataframe?
df = pd.DataFrame(data=dict_kv, columns = header) df.head() Provinces Confirmed cases Confirmed deaths Probable deaths 0 Azuay 10658 195 12 1 BolĂvar 2111 66 12 2 Cañar 2110 83 7 3 Carchi 3053 104 1 For instance, for this dataframe I only want parse to float the data in the columns: Confirmed cases, Confirmed deaths, Probable deaths
1 Answer
+ 1
You can create a new dataframe with the columns you want... something like this
new_df=df['Confirmed cases', 'Confirmed deaths', 'Probable deaths']