Answers for "df check value based on row and column id"

7

only keep rows of a dataframe based on a column value

df.loc[df['column_name'] == some_value]
Posted by: Guest on April-13-2020
0

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)]
Posted by: Guest on May-30-2021

Code answers related to "df check value based on row and column id"

Python Answers by Framework

Browse Popular Code Answers by Language