In my python function I get a dataframe and a condition as a string.
def my_def(df, condition):
The goal is to filter the dataframe by the condition, with pandas.
I've seen solutions like this one:
Select rows from a DataFrame based on values in a column in pandas
But it doesn't help me, because the condition parameter looks like this:
'name = 'you''
The filter is on the column "name" with value "you",
But in the solution above I must split the column name and the value from that string.
Is there a way to filter on all dataframes and not on a specific column?
In the end, It's like doing:
"where name = 'you'"
on the dataframe, so I guess it is possible.
Thanks.