0

I am looking for a way to filter df by the below conditions:

the value in created_by column equals the value in the owner column and status equals 'Active'

enter image description here

smci
  • 32,567
  • 20
  • 113
  • 146

2 Answers2

0

Solution:

(df['created_by']==df['owner']) & (df['status']=='Active')

and please read the User Guide: Indexing and selecting data

smci
  • 32,567
  • 20
  • 113
  • 146
0

the logic of the condition you want to implement is that you want to filter all the rows that their created_by value is different than their owner value and also the status should be active.

if ((customers_df["created_by"] == customers_df["owner"]) & (customers_df["status"] == "Active")):
    # do your  Business logic
Azzedine
  • 345
  • 2
  • 6