Skip to content
Advertisement

Python Pandas finding column value based on multiple column values in same data frame

df:

JavaScript

Now I want to get city name where “fruit= orange and price =5”

JavaScript

is not working and giving error as:

JavaScript

Versions used: Python 3.5

Advertisement

Answer

You could create masks step-wise and see how they look like:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement