Skip to content
Advertisement

Find rows that have in the cells duplicates symbols

I have a dataframe that has columns with strings and columns with floats.

some values in the cells have two symbols like this:

-0.015-0.156 ==> middle ‘-‘ is not ok, two dots not ok

0.014-0.106 ==> middle ‘-‘ is not ok, two dots not ok

0.013.0.156 ==> two dots not ok

-0.015 ==> ok

0.013 ==> ok

I want to find all the rows that have a value that is “not ok”.

how can I do it?, Maybe with a condition of two dots.

Advertisement

Answer

try using, pd.to_numeric by setting error to coerce

JavaScript

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement