Home > database >  Filter dataframe rows regarding two values
Filter dataframe rows regarding two values

Time:04-13

I try to filter my df regarding two values but it always return every rows, not sure why

#print(nom_proprietaire) -> John
#print(adresse_location) -> 45 st

resultat_adresse = df_mandats.loc[(df_mandats['NOM_PROPRIETAIRE'] == nom_proprietaire) & (df_mandats['ADRESSE_LOCATION'] == adresse_location)]

enter image description here

CodePudding user response:

Try :

print(df_mandats[(df_mandats.NOM_PROPRIETAIRE == nom_proprietaire) & (df_mandats.ADRESSE_LOCATION == adresse_location)])

CodePudding user response:

Okay sorry guys, there was a typo in my parameters :)

  • Related