I have a Series of strings (timestamps) and I would like to conditionally replace sub-string inside these strings: - if there is a '+' character, I want to replace it with '-' - or on the opposite, if there is a '-' character, I want to replace it with a '+'
I obviously cannot use simply replace() without condition, or in the end, all + & - will be converted to a single + character.
mySeries = mySeries.str.replace('+','-', regex=False)
mySeries = mySeries.str.replace('-','+', regex=False)
Please, how should I operate this sign inversion?
I thank you in advance for your help. Have a good day,
Bests,
Pierre