Skip to content
Advertisement

TypeError: argument of type ‘float’ is not iterable. Trying to find rows which doesn’t contain specific words in pandas dataframe

My dataframe looks like this(not exactly, but here is the sample):

JavaScript

and I’m trying to find rows only have ‘word’ but without ‘not’

here is my code:

JavaScript

and I’m getting this error:

JavaScript

I don’t understand why I’m getting this error cause df3[‘WARNSIGN_DTL’] column is string type, not float

Advertisement

Answer

Use parentheses when you use ‘&’ conditions. Change it from :

JavaScript

to this

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