I have a dataframe of the following format:
Name Factor Expression Year
Hydro 0.075 <10 2010
Hydro 0.075 >10 2010
Hydro 0.075 <10 2011
Hydro 0.075 >10 2011
Hydro 0.075 <10 2012
And the following variable: i=3
.
I would like to filter the dataframe where the Expression
column evaluates as true, when the variable i
is on the left hand side of the string in the column of expression.
For example, the first row would evaluate to true as 3<10
.
The resulting dataframe that I would like is:
Name Factor Expression Year
Hydro 0.075 <10 2010
Hydro 0.075 <10 2011
Hydro 0.075 <10 2012
Thank you for any help.