Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to select rows with specific values in pandas

#To select rows whose column value is in an iterable array, which we'll define as array, you can use isin:
array = ['yellow', 'green']
df.loc[df['favorite_color'].isin(array)]
Source by www.interviewqs.com #
 
PREVIOUS NEXT
Tagged: #select #rows #specific #values #pandas
ADD COMMENT
Topic
Name
5+2 =