I have a Pandas DF where I need to filter out some rows that contains values == 0 for feature 'a' and feature 'b'.
In order to inspect the values, I run the following:
DF1 = DF[DF['a'] == 0]
Which returns the right values. Similarly, by doing this:
DF2 = DF[DF['b'] == 0]
I can see the 0 values for feature 'b'.
However, if I try to combine these 2 in a single line of code using the OR operand:
DF3 = DF[DF['a'] == 0 | DF['b'] == 0]
I get this:
TypeError: cannot compare a dtyped [float64] array with a scalar of type [bool]
What's happening here?