Emp_rating_df
Emp_Id A1 A2 A3 A4
0 1001 4 3 6 7
1 1002 7 2 4 5
2 1003 3 8 2 6
3 1004 7 5 4 7
Comp_df
Emp_Id A1 A2 A3 A4
0 1001 4 3 6 7
I need to compare two df which contains employee ratings.
Emp_rating_df contains employee ratings out of 10 and Comp_df tells which employee to compare with all the employees from Emp_rating_df.
If emp A has rating more than in any particular advantage column (A1, A2, A3, A4) then emp B then 2 , if same then 1 else 0.
Output_df-
Emp_Id A1 A2 A3 A4
0 1001 1 1 1 1
1 1002 0 2 2 2
2 1003 2 0 2 2
3 1004 0 0 2 1
First row would be 1 because of self comparison.