Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'P': range(1, 6),
'Q': range(10, 0, -2),
'R R': range(10, 5, -1)})
df
df.query('P > Q')
df[df.P > df.Q]
import pandas as pd
df = pd.DataFrame({'P': range(1, 6),
'Q': range(10, 0, -2),
'R R': range(10, 5, -1)})
df.query('Q == `R R`')
df[df.Q == df['R R']]