Consider the following table:
Obj Bits Eq Result
A 5 5*Bits+20 45
B 10 7*Bits+8 78
C 11 12*Bits+100 232
I would like to create a column Result which evaluates the expression in column Eq
. These equations are not fixed and can vary per row. However, the variables used in the equation will be one or more column names in the dataframe. How do I go about accomplishing this? I know Pandas has the eval
method but in my case the equation per row can be different. Thanks for any ideas.