I have a dataset like this (with many more columns):
FLAG__DC SEXECOND CRM_TAUX
0 N M 0,9
1 N M 0,9
2 N M 1,2
3 O M 1
4 N M 1
5 N M 0,9
6 O M 1
7 N M 0,9
I want to convert the column CRM_TAUX to Float... Please help!
I have tried this but doesn't work:
df['CRM_TAUX'] = df.CRM_TAUX.replace(',','.')
df['CRM_TAUX'] = df.CRM_TAUX.apply(pd.to_numeric)
This is the error I get (and many more):
Unable to parse string "1,2" at position 0
Thanks in advance!