My table value looks like
label title
misc barbie song
misc
hello monster
misc girls song
misc barbie doll
string_list = ['barbie','girls']
My expected output
label new_label
misc barbie
misc
hello monster
misc girls
misc barbie
I want to work on the label with 'misc' then check if it has video title, if video title is present, I want to check if any of the strings appear in the corresponding video title and either replace misc with it matched string from the list or create a new column called new_label and have them there.
If the misc does not have any video title it should be blank also, any label other than misc should retain their old value
Is this achievable in pandas? This logic is quite tricky for me