When I import an Excel file, some numbers in a column are float and some are not. How can I convert all to float? The space in 3 000,00
is causing me problems.
df['column']:
column
0 3 000,00
1 156.00
2 0
I am trying:
df['column'] = df['column'].str.replace(' ','')
but it's not working. I would do after .astype(float)
, but cannot get there.
Any solutions? 1
is already a float, but 0
is a string.