Answers for "select dataframe with 2 conditions"

8

filter dataframe multiple conditions

# when you wrap conditions in parantheses, you give order
# you do those in brackets first before 'and'
# AND
movies[(movies.duration >= 200) & (movies.genre == 'Drama')]
Posted by: Guest on March-21-2020
3

select rows with multiple conditions pandas query

df.query('Salary_in_1000 >= 100 & Age < 60 & FT_Team.str.startswith("S").values')
Posted by: Guest on June-20-2020

Code answers related to "select dataframe with 2 conditions"

Python Answers by Framework

Browse Popular Code Answers by Language