I have a dataset with a column value :
0 TCGA-A2-A0T2
1 TCGA-A2-A0CM
2 TCGA-BH-A18V
3 TCGA-BH-A18Q
4 TCGA-BH-A0E0
However, I want to change it to:
A0T2
A0CM
A18V
A18Q
A0E0
I have tried code such as
df1['Complete TCGA ID'].str.extract('TCAG-(.*)-.*')
But it only returns NA. I really don't know how to figure out regular expression in this case. Can anyone please help? Thanks so much in advance!