Suppose we have this dataframe
rows = [['credit', 1, 1, 2, 3]]
columns = ['Type', 'amount', 'active', 'amount', 'active']
df = pd.DataFrame(rows, columns=columns)
df = df.set_index('Type')
amount active amount active
Type
credit 1 1 2 3
I need to modify it so it will group columns and show both values for index Like this
amount active
Type
credit 1 1
2 3
How can i achieve that?