Skip to content
Advertisement

I want to compare the values in pandas

I have two dataframes. First one:

JavaScript

second one:

JavaScript

this is the first one:

JavaScript

this is the second one:

JavaScript

I want to do two things:

  1. if the second one’s user is not in the first one, then print out. like: www is not in the list

  2. if the user is in the list, but group is not equal then print out:
    like xxx user have more: super admin than the list
    zzz user has less: admin than the list.

Advertisement

Answer

If there are same index values ina number of length in both DataFrame and need compare values per rows:

JavaScript

JavaScript

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement