value result
1 fish +d de hzd +po
2 duck +g lo kju +okz -kji
3 mouse +z gh +k
4 rabbit +bhh uj +okk
5 donky -de thb +thy
And the expected data should look like:
value result
1 fish de hzd
2 duck lo kju
3 mouse gh
4 rabbit uj
5 donky thb
I tried
df["result"] = [x.lstrip("+- + aAbBcC") for x in df["result"]
but it only strips the first string appeared:
value result
1 fish de hzd +po
2 duck lo kju +okz -kji
3 mouse gh +k
4 rabbit uj +okk
5 donky thb +thy
is there a way to fix this, to get the expected data? thank you.