with pandas: round(np.cumsum(x['volume']*(x['high']+x['low']+x['close'])/3) / np.cumsum(x['volume']),2)
Here, I think it will be better to store data (np.cumsum(x['volume']*(x['high']+x['low']+x['close'])/3) and np.cumsum(x['volume'])) at each step to reduce the calculation at each step.
with pandas:
round(np.cumsum(x['volume']*(x['high']+x['low']+x['close'])/3) / np.cumsum(x['volume']),2)
Here, I think it will be better to store data (np.cumsum(x['volume']*(x['high']+x['low']+x['close'])/3)
andnp.cumsum(x['volume'])
) at each step to reduce the calculation at each step.