Filter by comparing two columns
Erlebacher
Registered Posts: 82 ✭✭
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
Tagged:
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