I have a dataframe with a column having either +1, 0 or -1. I would like to do the cumsum() keeping the result between -3 and +3. Example: for the series, [+1, +1, +1, +1, 0, -1], I am expecting the result [+1, +2, +3, +3, +3, +2]. Any clue? Thx a lot.