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'
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'
Solution:
(df['created_by']==df['owner']) & (df['status']=='Active')
and please read the User Guide: Indexing and selecting data
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