def align_arrays(A):
    time, data = A
time_new = np.arange(np.max(time) + 1)
data_new = np.full(time_new.size, None, dtype=object)
data_new[np.in1d(time_new, time)] = data
return time_new, data_new
Align python arrays with missing data