say my column is something like this:
trade_signal
buy
buy
buy
buy
sell
sell
sell
sell
buy
buy
buy
sell
sell
buy
sell
buy
I would like to drop the duplicate elements in the column and replace them with NAN or 0 so it would end up with something like:
trade_signal
buy
nan
nan
nan
sell
nan
nan
nan
buy
nan
nan
sell
nan
buy
sell
buy
I am completely unsure of the logic I can use to do this, I think I would forward fill up until the next change in signal with NAN values somehow?