I need a fast way to keep a running maximum of a numpy array. For example, if my array was:
x = numpy.array([11,12,13,20,19,18,17,18,23,21])
As suggested, there is scipy.maximum.accumulate:
scipy.maximum.accumulate
In [9]: x Out[9]: [1, 3, 2, 5, 4] In [10]: scipy.maximum.accumulate(x) Out[10]: array([1, 3, 3, 5, 5])