I have a Dataframe which I get from csv file using
df = pd.read_csv('data.csv')
I want to select some of the rows of this Dataframe and create a new Dataframe but the logic to select those rows is complex and needs to be inside a function. And this filter logic uses data from that row only, not from any other rows in the Dataframe. So how can I create a new Dataframe by using this filter function so select rows from this Dataframe?