Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'P': range(1, 5), 'Q': range(8, 0, -2)})
df
df.eval('P + Q')
Assignment is allowed though by default the original DataFrame is not modified.
df.eval('R = P + Q')
df
Use inplace=True to modify the original DataFrame.
df.eval('R = P + Q', inplace=True)
df