My df data has two columns like this
thePerson theText
"the abc" "this is about the abc"
"xyz" "this is about tyu"
"wxy" "this is about abc"
"wxy" "this is about WXY"
I want a result df as
thePerson theText
"the abc" "this is about <b>the abc</b>"
"xyz" "this is about tyu"
"wxy" "this is about abc"
"wxy" "this is about <b>WXY</b>"
Notice if theText in the same row contains thePerson, it becomes bold in theText.
One of solution I unsuccessfully tried is this:
df['theText']=df['theText'].replace(df.thePerson,'<b>'+df.thePerson+'</b>', regex=True)
I wonder if I can do this using lapply or map
My python environment is set to version 2.7