I have two dataframes. First one:
import pandas as pd
a = [['xxx', 'admin'], ['yyy', 'admin,super admin'], ['zzz', 'guest,admin,superadmin']]
df1 = pd.DataFrame(a, columns=['user', 'groups'])
second one:
b = [['xxx', 'admin,super admin'], ['www', 'admin,super admin'], ['zzz', 'guest,superadmin']]
df2 = pd.DataFrame(b, columns=['user', 'groups'])
this is the first one:
user groups
0 xxx admin
1 yyy admin,super admin
2 zzz guest,admin,superadmin
this is the second one:
user groups
0 xxx admin,super admin
1 www admin,super admin
2 zzz guest,superadmin
I want to do two things:
if the second one's user is not in the first one, then print out. like: www is not in the list
if the user is in the list, but group is not equal then print out:
likexxx
user have more:super admin
than the list
zzz
user has less:admin
than the list.