I have an object column with amounts like 150,01 and 43,69. Thee are about 5,000 rows.
Naturally, I tried to convert the series into the locale format, which suppose to turn it into a float format. I came back with the following error:
ValueError: could not convert string to float: ' - '
Now that I'm aware that there are non-numeric values in the list, I tried to use isnumeric methods to turn the non-numeric values to become NaN.
Unfortunately, due to the comma separated structure, all the values would turn into -1.
How do I turn the "," values to "." by first removing the "-" values? I tried .drop() or .truncate it does not help. If I replace the str",", " ", it would also cause trouble since there is a non-integer value.
Please help!
Documentation that I came across Finding non-numeric rows in dataframe in pandas? Replace comma and dot in Pandas
source https://stackoverflow.com/questions/69382012/unable-to-convert-comma-separated-integers-and-non-integer-values-in-a-series-co
Comments
Post a Comment