uf = np.frompyfunc(lambda a, b: a + (b - a) * 0.5, 2, 1)
uf.accumulate([2, 3, 5, 8, 3, 5], dtype=np.object).astype(np.float)
How to apply a function to each element of an array when the result is dependent of preceding cell