.
case () , DataFrame , ( /) common.. , - ()
:
dfA = pd.DataFrame([[1,2,3], [4,5,6]], columns=["X", "Y", "Z"])
dfB = pd.DataFrame([[1,3,3], [4,1,6]], columns=["X", "Y", "Z"])
q = "(X > 3) & (Y < 10)"
print(dfA.query(q))
print(dfB.query(q))
X Y Z
1 4 5 6
X Y Z
1 4 1 6
df.query('a < b and b < c')
df.query('a in [3, 4, 5]')
df.query('a == [1, 3, 5]')