mux = pd.MultiIndex.from_product([['status', 'type'], [('p%i' % i) for i in
    range(1, 6)]])
data = np.concatenate([np.random.choice((0, 1), (10, 5)), np.random.rand(10,
    5)], axis=1)
df = pd.DataFrame(data, columns=mux)
df
Pandas Calculate Sum of Multiple Columns Given Multiple Conditions