0

I am just trying to write a condition that checks two columns from my pandas df and return records only where plan = free and role = owner as shown below. BUT i get an error due to my 'and' condition below. Is there an easy solution here?

Table:

plan | role  | [...]
free | owner | [...] 
trial| guest | [...] 

Python

free_admin = (df['plan'] == 'free' and df['role'] == 'owner')
df_try = df[free_admin]
df_try.head()
Blackdynomite
  • 325
  • 1
  • 9

0 Answers0