groupByCol = "FID" elementFromColToList = "name_ID" temp = df.groupby(groupByCol)[elementFromColToList].apply(list).to_frame() temp groupid b 1 [1, 2, 3] 3 [27] 4 [42, 42, 8]