Q:

python pandas re-associate non-numerical data after sum

So we have some set of data like this:
email, name, price, quantity
a@a.com, alan, 5.3, 2
b@a.com, barbara, 3.99, 1
b@a.com, barbara, 1, 1

...

z@z.com, zed, 3, 1

So now if we have this in a dataframe it's pretty easy to do
df.groupby(['email']).sum()

          price     quantity
email

a@a.com    5.3      2
b@a.com   4.99      2

So no we have the numerical interesting part but not the text part. How can I merge the text parts back in with the sums?
So the desired final state of this would be something like:
email, name, price_sum, quantity_sum
a@a.com, alan, 5.3, 2
b@b.com, barbara, 4.99, 2
...
z@z.com, zed, 3, 1

A:

You could aggregate, names by taking the first value. 
In [283]: df.groupby('email').agg({'price': sum, 'quantity': sum, 'name': 'first'
     ...: })
Out[283]:
         price     name  quantity
email
a@a.com   5.30     alan         2
b@a.com   4.99  barbara         2

Or, you could aggregate names into a dict. 
In [281]: df.groupby('email').agg({'price': sum, 'quantity': sum, 'name': lambda x
     ...: : x.value_counts().to_dict()})
Out[281]:
         price             name  quantity
email
a@a.com   5.30     {u'alan': 1}         2
b@a.com   4.99  {u'barbara': 2}         2

Or, if you were looking to add as string.
In [282]: df.groupby('email').agg({'price': sum, 'quantity': sum, 'name': sum })
Out[282]:
         price            name  quantity
email
a@a.com   5.30            alan         2
b@a.com   4.99  barbarabarbara         2

But, for a specific case where your email-name combination is same, you can go with Igor Raush's suggestion df.groupby(['name', 'email'], as_index=False).sum()

