I need to replace columnb value with a mapping dictionary, but I cannot split those columns and map it and the concat everything back to same place that would be a tedious task. Any help on this would be great.
df:
ColumnA ColumB
0 Rick 3-1,4-5,9-8
1 Tim 6-3,1-2,1.3,5.8,7-9
Mapping_dict= {'3-1':'1','4-5':2,'9-8':3,
'6-3':4,'1-2':5,'1.3':6,'5.8':'7','7-9':'8'}
Output:
ColumnA ColumB
0 Rick 1,2,3
1 Tim 4,5,6,7,8