I want to create separate columns for each item in the 'name' lists for each row in this pandas dataframe. The 'name' lists have between 1-10 items, and I just want the column heads to be "1", "2", "3", etc.
out = dataframe.groupby(by=['location'], as_index=False).agg({'people':'sum', 'name':list})
Is there a way to split the aggregated list like this?

