I have following column in a DataFrame.
col1
['SNOMEDCT_US:32113001', 'UMLS:C0265660']
['UMLS:C2674738', 'UMLS:C2674739']
['UMLS:C1290857', 'SNOMEDCT_US:118930001', 'UMLS:C123455']
I would like extract the value after UMLS: and store it in another column. I am trying following lines of code but I am not getting the expected output.
df['col1'].str.extract(r'\['.*UMLS:(.*)]')
The expected output is:
col1 col2
['SNOMEDCT_US:32113001', 'UMLS:C0265660'] C0265660
['UMLS:C2674738', 'UMLS:C2674739'] C2674738, C2674739
['UMLS:C1290857', 'SNOMEDCT_US:118930001', 'UMLS:C123455'] C1290857, C123455