Answers for "where two conditions pandas"

8

pandas two conditions filter

# 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
1

how to add three conditions in np.where in pandas dataframe

import numpy as np
idx = np.where((df['Salary_in_1000']>=100) & (df['Age']< 60) & (df['FT_Team'].str.startswith('S')))
Posted by: Guest on April-26-2020

Code answers related to "where two conditions pandas"

Python Answers by Framework

Browse Popular Code Answers by Language