numpy.maximum.accumulate
works for me.
>>> import numpy
>>> numpy.maximum.accumulate(numpy.array([11,12,13,20,19,18,17,18,23,21]))
array([11, 12, 13, 20, 20, 20, 20, 20, 23, 23])
More Related Contents:
- Taking subarrays from numpy array with given stride/stepsize
- ‘and’ (boolean) vs ‘&’ (bitwise) – Why difference in behavior with lists vs numpy arrays?
- Moving average or running mean
- Unable to allocate array with shape and data type
- Python/NumPy first occurrence of subarray
- What is the internal precision of numpy.float128?
- Use a.any() or a.all()
- Restart cumsum and get index if cumsum more than value
- ValueError: numpy.dtype has the wrong size, try recompiling
- Implement MATLAB’s im2col ‘sliding’ in Python
- subsampling every nth entry in a numpy array
- Python’s sum vs. NumPy’s numpy.sum
- When should I use hstack/vstack vs append vs concatenate vs column_stack?
- Type hinting / annotation (PEP 484) for numpy.ndarray
- Pass percentiles to pandas agg function
- 2D and 3D Scatter Histograms from arrays in Python
- Weighted choice short and simple [duplicate]
- How does numpy.histogram() work?
- Max in a sliding window in NumPy array
- Get first and second highest values in pandas columns
- ImportError: No module named ‘pandas.indexes’
- Averaging over every n elements of a numpy array
- In Python NumPy what is a dimension and axis?
- Difference between Python float and numpy float32
- Form a big 2d array from multiple smaller 2d arrays
- Sieve of Eratosthenes – Primes between X and N
- Stratified Sampling in Pandas
- pylab.hist(data, normed=1). Normalization seems to work incorrect
- Numpy transpose of 1D array not giving expected result
- Speedup scipy griddata for multiple interpolations between two irregular grids