Filter by comparing two columns

I have a dataset with two columns, say A and B. I would like to only keep the rows where the content of A == content of B. In Pandas, this is expressed as:
```df = df[df['A'] == df['B']]```
Is this possible using Dataiku recipes? I tried with sample/filter recipe but could not figure out how to accomplish this. As a note, I already have my own recipe to perform complex filtering, but my client wishes as much as possible to be performed through Dataiku recipes. Thanks.
Operating system used: mac ventura
Best Answer
-
Hi,
How about to use "filter rows/cells with formula" in the prepare recipe?
Just enter the formula A == B
Hope this helps
Best
Answers
-
You can do this directly without a formula, you can add a condition and use the "is different from" or "is the same as" and that will prompt you to pick 2 columns to compare in your sample/filter recipe