I have a data frame df and it has multiple columns. One column say is amount. So it can be referred as df['amount']. The user needs to see its data based on criteria (s)he pass from front end. Let's assume (s)he passed '>=' and I stored this operator in a variable (say operator_var1). And lets say (s)he also passed one threshold for amount value (say amount_threshold) we need to show the filter data-frame based on operator and threhold value like
df = df[(df['amount'] operator_var1 amount_threshold)]
But the above shows error. Any simple way to achieve this. Please suggest.
Thanks