I would like to implement a specific join operation with the following requirements:
I have a data frame in the following format, where the index is datetime and I have columns from 0 to N (9 in this example)
df1:
0 1 2 3 4 5 6 7 8 9 2001-01-01 2 53 35 91 43 31 7 87 25 68 2001-01-02 12 97 86 59 51 7 75 25 6 40 2001-01-03 73 82 87 1 46 66 17 42 96 61 I also have another dataframe that contains the columns to be chosen for each datetime index, i.e. the values are 0 to N:
0 2001-01-01 9 2001-01-02 5 2001-01-03 4 I would like to select the underlying values of the first dataframe, where
index df1 = index df2 columns df1 = value df2 For example the results for the above example should look like this:
join(df1,df2)= 0 2001-01-01 68 2001-01-02 7 2001-01-03 46