I have a dataframe with a column that includes a list of IDs. I've created a dictionary that associates the IDS with a string value. I'd like to replace the int values with the string.
Name Label_ID
Project1 [1]
Project2 [3,5]
label_map={1:'blue', 3:'green',5:'large'}
I want to get an output of:
Name Label_ID
Project1 [blue]
Project2 [green, large]
I've tried using:
test['Tags']=test['Label_ID'].map(label_map)
This code runs, but the resulting 'Tags' column is just NaNs. Any guidance would be appreciated.