0

I have two different unmatch (columns&rows) data frame, actually one of these df is a subset of the other df. also we can call main and subset dfs. And I want to find matched values between subset and main df. Then I need to add the matched value from main df to subset df.

1 -- > also you can examine my example table For example:

>>dfa
Col1  Col2
1     0,01
2     0.002
3     0.02
4     0.003
5     0.004
6     0.005
7     0.008
>>dfs
Col1  Col2  
1     0,01  
2     0.002
3     0.02
4     0.004
> output
Col1  Col2    Col2
1     0,01    0,01 
2     0.002   0.002
3     0.02    0.02
4     0.003   NaN
5     0.004   0.004
6     0.005   NaN
7     0.008   NaN

In this example dfs is subset of dfa. and I want to find only same values from Col2 and add to dfs for new column.

Thanks all.

0 Answers0