Dataframe has two columns item-1 and item-2, I want to find average of Buy and Sell columns for all the rows where item-1 value is in item-2 and item-2 value is in item-1
Here the value of first row in item-1 is A, item-2 has value A at index 2,4 and 6, so the avg-item-1-buy should be average of buy value at those indexes
similarly the value of first row in item-2 is C, item-1 has value C at index 2 and 5, so the avg-item-2-buy should be average of buy value at those indexes
Expected Result:


