I have a data frame
Name Subset Type System
A00 IU00-A OP A
A00 IT00 PP A
B01 IT-01A PP B
B01 IU OP B
B03 IM-09-B LP A
B03 IM03A OP A
B03 IT-09 OP A
D09 IT OP A
D09 IM LP B
D09 IM OP A
The abouve dataframe, I need to convert it based on Grouping Name and Subset strings extracted using extractall(r'[^a-zA-Z]*([a-zA-Z]+)[^,]*').groupby(level=0).agg(', '.join). And Systems, Subsets Should be mentioned serially according to Types.
Output Example:
Subset Cluster Type Cluster Name System Subsets
IU,IT OP,PP A00,B01 A,A,B,B IU00-A,IT00
IM,IM,IT LP, OP, OP B03, D09 A,A,A,A,B,A IM-09-B,IM03A,IT-09,IT,IM,IM