Hi everyone! I have two different dataframes which I need to merge but not completely in order to get the third one:
The value of reference is the column [1] in both DF1 and DF2, the new column in DF1 must have the values of column[3] of DF2 to create DF3 but only the ones corresponding to the values of column [1] of DF1, how can I achieve this? I've tried with merge and melt but i doesn't work since I don't know how to consider the different lengths in the reference columns for the match.
DF1
0 1 2 3 4 5 6 0 12345678 40 10.610,000 1294822 22345679 HCTFCILE 16000 1 12345678 100 8.196,001 1294822 22345679 HCTFCILE 10000 2 12345678 110 1.062,000 1294822 22345679 HCTFCILE 1000 3 12345678 130 2.850,000 1294822 22345679 HCTFCILE 12000 DF2
0 1 2 3 0 1294822 10 DM 13500 1 1294822 20 DM 33500 2 1294822 30 DM 18300 3 1294822 40 DM 22200 4 1294822 90 DM 16200 5 1294822 100 DM 24500 6 1294822 110 DM 27800 7 1294822 120 DM 15500 8 1294822 130 DM 13400 Expected Result DF3:
0 1 2 3 4 5 6 7 0 12345678 40 10.610,000 1294822 22345679 HCTFCILE 16000 22200 1 12345678 100 8.196,001 1294822 22345679 HCTFCILE 10000 24500 2 12345678 110 1.062,000 1294822 22345679 HCTFCILE 1000 27800 3 12345678 130 2.850,000 1294822 22345679 HCTFCILE 12000 13400 Thank you for your help in advance. (: