I have df1:
index Year var1 var2 var3
0 2010 8 9 10
1 2011 11 12 13
.
.
998 2012 4 1 55
999 2011 19 10 18
and I have df2
index var4
2010 7.5
2011 5.7
2012 4.9
How can I create a new column in df1
called var4
that matches the column Year
with index
of df2 and return var4
. I have different rows for two tables and in my data years are between 2008 to 2018.