i have example dataset want groupby 1 column , produce 4 new columns based on of values of existing columns. here sample data: data = {'alignmentid': {0: u'ensmust00000000001.4-1', 1: u'ensmust00000000001.4-1', 2: u'ensmust00000000003.13-0', 3: u'ensmust00000000003.13-0', 4: u'ensmust00000000003.13-0'}, 'name': {0: u'noncodingdeletion', 1: u'noncodinginsertion', 2: u'codingdeletion', 3: u'codinginsertion', 4: u'noncodingdeletion'}, 'value_cds': {0: nan, 1: nan, 2: 1.0, 3: 1.0, 4: nan}, 'value_mrna': {0: 21.0, 1: 26.0, 2: 1.0, 3: 1.0, 4: 2.0}} df = pd.dataframe.from_dict(data) which looks this: alignmentid name value_mrna value_cds 0 ensmust00000000001.4-1 noncodingdeletion 21.0 nan 1 ensmust00000000001.4-1 noncodinginsertion 26.0 nan 2 ensmust00000000003.13-0 codingdeletion...