# How Pandas Uses Boolean Operators

As filtering can be a bit tricky in Pandas, you’ll learn in this lesson how Pandas uses boolean operators.

**Matt Williams** on Aug. 18, 2020

I don’t know that the statement above is correct, because if you perform the evaluation `5 < 3 or 3 < 4`

, the output is `True`

. Obviously the interpreter looked at both numerical comparisons in the operation, otherwise it would have stopped at `5 < 3`

and returned false, as rworreby is suggesting above.

**Dan Bader** RP Team on Aug. 18, 2020

Thanks for flagging this @rworreby. What’s referred to as “short-circuit evaluation” in the video around the 1:30 mark isn’t actually short-circuit evaluation but the evaluation of a nested boolean expression.

We’ll get the terminology cleared up with the next update of this course. Sorry about any confusion this may have caused.

In the meantime, please check out the following resources for a deeper look at short-circuit evaluation of boolean expressions in Python:

Become a Member to join the conversation.

rworrebyon May 27, 2020I actually want to point out a section that is wrong in this video, starting from 1:00 to 1:45:

As Python uses short-circuit evaluation for algebraic expressions, the expression in the video (

`4 < 3 and 5 > 4`

) would be treated the following way:`4 < 3`

is False and therefore the expression would return False immediately (as “False and ” is always false). The statement in the video that`4 < 3`

is evaluated, then`5 > 3`

is evaluated and then both compared (???) is therefore wrong.In the next section, short-circuit evaluation is mentioned, however, in the example that is given, there is no short-circuit evaluation, as its a nested comparison. It is also wrong that

`(3 and 5)`

“just” evaluates to 5. In a logical test, the result is the last evaluated statement. Itsnotthe last argument.As a reference, check the following things:

I think in the video there is a wrong understanding of what short-circuit evaluation is. Truth tables is a thing to check out, but applied to boolean logic in python these are the base cases of short-circuit evaluation: