Filter by comparing two columns

Solved!
Erlebacher
Level 4
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

0 Kudos
1 Solution
FlorentD
Developer Advocate

Hi,

How about to use "filter rows/cells with formula" in the prepare recipe?

Just enter the formula A == B

Hope this helps

Best

View solution in original post

0 Kudos
1 Reply
FlorentD
Developer Advocate

Hi,

How about to use "filter rows/cells with formula" in the prepare recipe?

Just enter the formula A == B

Hope this helps

Best

0 Kudos