index = pd.MultiIndex.from_product([pairs, [1, 2]], names=['pair', 'cond'])
df = pd.DataFrame(result, index=index, columns=['mean', 'sum', 'count'])
How to apply Pandas Groupby with multiple conditions for split and apply multiple calculations?