I have a dataframe that has the following columns:
id index1 index2 value
DivA 1 4 3
DivA 3 6 4
DivB 1 3 5
DivB 5 7 3
On another dataframe I have the following:
id index
DivA 1
DivA 2
...
DivA 10
DivB 1
...
final result: df2:
id index value
DivA 1 3
DivA 2 nan (because no value in df1)
DivA 3 4
DivA 4 3
...
DivA 10 nan (because no value in df1)
DivB 1 5
...
I'm wondering if I can add a new column 'value' to the second df in a way that 'index1' and 'index2' are combined and that 'value' in the second df can have 'nan' if there is no values in the first dataframe 'value' ?
Thank you for help !