I can't find an elegant solution to merge those two datasets:
Let's say I have a first dataset, with temperatures of cities
2016 2017
cityA 23 27
cityB 24 28
And another one with a lot of information, but that looks like that:
city year other
0 cityA 2016 aa
1 cityB 2017 bb
2 cityA 2016 cc
3 cityB 2017 dd
And I would like the following result:
city year other temperatures
0 cityA 2016 aa 23
1 cityB 2017 bb 28
2 cityA 2016 cc 23
3 cityB 2017 dd 24
Thanks for your help!
EDIT : real and more complex dataframes:
results of the implementation of the answer:


