Q:

Expand Pandas Group By to Many Columns

I have a dataframe like this,
create a data frame data
d = {'Machine ID': [100, 100, 101, 101], 'Machine': ["ABC", "ABC", "CDQ", "CDQ"], 
    "June": [10,0,12,15], "July": [12,15,0,32], "August": [0,15,20,11]}
data = pd.DataFrame(data=d)

Data Frame:
 Machine ID Machine June    July    August
0   100     ABC      10     12     0
1   100     ABC      0      15     15
2   101     CDQ      12     0      20
3   101     CDQ      15     32     11

Now, I want to groupby and aggregate by month, so, I did this,
machine_group = data.groupby(['Machine ID','Machine'])['June'].sum().reset_index(name = 'June Sum')

I get the following,
 Machine ID Machine June Sum
0   100     ABC     10
1   101     CDQ     27

However, I need an ouput something like this
         Machine ID Machine June Sum July Sum August Sum
    0   100     ABC         10       27       15
    1   101     CDQ         27       32       31

How can I expand my group by code to get them lines up. Otherwise, for now, my option is to group by each month and append grouped column into a new data frame. 
Any suggestion will be appreciated. 

A:

Try:
machine_group = data.groupby(['Machine ID','Machine']).sum()\
                    .add_suffix(' Sum').reset_index()

Output:
   Machine ID Machine  June Sum  July Sum  August Sum
0         100     ABC        10        27          15
1         101     CDQ        27        32          31

