You can do this with numpy. reshape
can be used to group data into chunks to calculate stats:
import numpy as np
// data
time = np.arange(1.0,22.0)
distance = time ** 2
// group data into chunks to get stats
meanTime = np.mean(time.reshape(-1,3),axis=1)
meanDistance = np.mean(distance.reshape(-1,3), axis=1)
std = np.std(distance.reshape(-1,3), axis=1)