I have been trying to evaluate math expressions in the Resolution and o_resolution columns. I have used regex to change x
into *
and have used the eval function to try to evaluate the expressions in the column but nothing is happening. Any suggestions?
colRes = df [['resolution', 'o_resolution']]
colRes = df[['resolution', 'o_resolution']].replace('x','*',regex=True)
colRes = df[['resolution', 'o_resolution']].apply(lambda x:eval('x'))