to convert the columns to numeric types, you have four main options:
- to_numeric()
- astype()
- infer_objects()
- convert_dtypes()
however, none of the four works in this case because each value has a thousands separator with a comma and a decimal separator with a dot, so this causes error.
You must delete the comma and then you can convert it to numeric.
df[column].str.replace(",", "").astype(float)
Top comments (0)