mercredi 15 juin 2016

Invalid literal for float() in Pandas


I am working on a dataset with more than 60M rows in Pandas. In one of my numeric columns, I suspect that there is a non-numeric char which gives me the error message "invalid literal for float(): 4010146209+".

I am able to load the column as obj but not as float or int.

I have tried replacing r"d" and "+" with "".

I need to either remove rows with non-numeric char in defined column or remove all char keeping the column from being loaded as float or int.

The column contains NaN, but these are dropped before I try to cast as float.


Aucun commentaire:

Enregistrer un commentaire