Я считаю, что вы можете использовать:
repeat = df['Seasonality_index'].max() + 1
#first convert first group values to list
a = df1['Seasonality'].tolist()[:repeat]
print (a)
[0.12, 0.06, 0.01, -0.04, -0.09, -0.1, -0.13]
#reorder values by constant
first = df['Seasonality_index'].iat[-1] + 1
b= a[first:] + a[:first]
print (b)
[-0.04, -0.09, -0.1, -0.13, 0.12, 0.06, 0.01]
#repeat values by length of df2
arr = np.tile(b, int(len(df2) // repeat) + repeat)
#assign by length of df2
df2['test'] = arr[:len(df2)]
df2['Expected_output'] = df2['forecasted'] - arr[:len(df2)]
print (df2)
forecasted Expected_output test
Datetime
2019-01-01 10:00:00 7.21 7.25 -0.04
2019-01-01 11:00:00 7.20 7.29 -0.09
2019-01-01 12:00:00 7.19 7.29 -0.10
2019-01-01 13:00:00 7.18 7.31 -0.13
2019-01-01 14:00:00 7.19 7.07 0.12
2019-01-01 15:00:00 7.19 7.13 0.06
2019-01-01 16:00:00 7.20 7.19 0.01
2019-01-01 17:00:00 7.20 7.24 -0.04
2019-01-01 18:00:00 7.21 7.30 -0.09
2019-01-01 19:00:00 7.20 7.30 -0.10