Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to slicing dataframe using two 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')]
Source by www.ritchieng.com #
 
PREVIOUS NEXT
Tagged: #slicing #dataframe #conditions
ADD COMMENT
Topic
Name
7+2 =