I have two dataframes like following,
x y z
0 10 a 1
1 20 b 2
2 10 c 3
3 20 d 4
4 10 e 5
x a
0 10 1
1 20 1.5
for the first dataframe, I want to create a new column that will have '1' if value of column 'z' greater than the value of 'a' (from second dataframe) ,which has the same variable 'x', otherwise '0'.
For example, when it checks this row
2 10 c 3
it will become
2 10 c 3 1
Simply, I tried to write a method but my data is very big so my solution does not seem efficient. Maybe there are some pandas functionalities make it easier.