I am trying to calculate a column in a dataframe based on another data frame. It is used to calculate seniority bonus of a HR payroll.
the two dataframes are:
df1 = headcount
peopleID peopleSeniority
1 2
2 6
3 12
4 30
df2 = seniority_bonus
seniority seniorityBonus
5 500
10 1000
15 2000
20 3000
and I would like to write a script that return df2 Seniority bonus according to df1 people's seniority. Something that will do: if df1['people seniority'] > df2['seniority'] > , df2['senioritybonus'] like if df1 seniority in years > 5, 500 if df1 seniority in years > 10, 2000 ...
I've tried to use query but it is not working, I do not know how to write a loop that would be able to make the calculation.
Would anyone have an idea ?