Before = np.arange(range[0]-frame*n, range[0], n) During = np.arange(range[0], range[1], n) After = np.arange(range[1], range[1]+frame*n, n) Total = np.hstack((Before, During, After))