My output:
df with column final result
final result
13649 |ReviewNG-ICV|Other
13650 |Other|ReviewNG-AO
13652 |Other|ReviewNG-AO|ReviewNG-CL
0 |Other
1 |Other
2 |Other
I want replace(or remove part of string) where specific "|Other" combine with other "tags", but it will still remain if it alone in cell So required output:
final result
13649 |ReviewNG-ICV
13650 |ReviewNG-AO
13652 |ReviewNG-AO|ReviewNG-CL
0 |Other
1 |Other
2 |Other
I trying this code without any success:
df['final result']=df['final result'].apply(lambda x: x['final result'] if x['final result']!='|Other' else 'x')