I would to add to the CellID column a number in the way to classify them. The dataframe is this:
umap
CellID wnnUMAP_1 wnnUMAP_2
0 KO_d0_r1:AAACAGCCACCTGCTCx -8.127543 1.593849
1 KO_d0_r2:AAACAGCCACGTAATTx -7.246094 -4.566527
2 HT_d0_r1:AAACAGCCATAATGAGx 7.617473 2.449949
3 HT_d0_r2:AAACATGCACCTAATGx -7.944949 6.633856
And my resoult would be this one
umap
CellID wnnUMAP_1 wnnUMAP_2
0 KO_d0_r1:AAACAGCCACCTGCTCx-0 -8.127543 1.593849
1 KO_d0_r2:AAACAGCCACGTAATTx-1 -7.246094 -4.566527
2 HT_d0_r1:AAACAGCCATAATGAGx-2 7.617473 2.449949
3 HT_d0_r2:AAACATGCACCTAATGx-3 -7.944949 6.633856
I would to add the 0 to KO_d0_r1, a -1 to KO_d0_r2, a -2 to HT_do_r1 and a -3 HT_d0_r2.
This is just an example, I have a lot of strings that have the prefix KO_d0_r1, ecc., so I would to distinguish them by the suffix.
My attempt was:
umap = umap.rename(columns = {'Unnamed: 0':'CellID'})
But it doesn't work