Given these data frames...:
DF = pd.DataFrame({'COL1': ['A', 'B', 'C', 'D','D','D'],
'COL2': [11032, 1960, 11400, 11355, 8, 7],
'year': ['2016', '2017', '2018', '2019', '2020', '2021']})
DF
COL1 COL2 year
0 A 11032 2016
1 B 1960 2017
2 C 11400 2018
3 D 11355 2019
4 D 8 2020
5 D 7 2021
DF2 = pd.DataFrame({'ColX': ['D'], 'ColY':['2021'], 'ColZ':[100]
DF2
ColX ColY ColZ
0 D 2021 100
If the following conditions are met:
COL1 = ColX from DF2
year = ColY from DF2
Then change the value in COL2 to ColZ from DF2.
ColZvalues for the same matching pairs ofColXandColY?