Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas look for values in column with condition

# The common syntax is df.loc[], the condition is put in the bracket

#Eg, look for rows with column1 > 5 and column2 = 3
df.loc[(df['column_1'] > 5) & (df['column_2'] = 3)]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #values #column #condition
ADD COMMENT
Topic
Name
7+8 =