python 出错

import pandas as pd
import numpy as np



data = pd.read_csv('data/data1.csv',encoding='gbk')

l=['x1','x3','x4','x5','x6','x7','x8','x13']
data_1=data[l].copy()
data_1.index = range(1994,2014)
for _ in range(2):
data_1 = pd.concat([data_1,pd.Series(dtype='float64')], ignore_index=True)
outputfile = './data1_GM11.xls' #灰色预测后保存的路径

for i in l:
f=GM11(data_1[i][:-2].values)[0]
data_1[i][2014]=f(len(data_1)-1)
data_1[i][2015]=f(len(data_1))
data_1[i]=data_1[i].round(2)
y = list(data['y'])
y.extend([np.nan, np.nan])
data_1['y'] = y
data_1.to_excel('outputfile',engine='openpyxl')
print('预测结果为:', data_1.loc[2014:2015, :])

错误
ValueError Traceback (most recent call last)
Cell In [14], line 29
27 y = list(data['y'])
28 y.extend([np.nan, np.nan])
---> 29 data_1['y'] = y
31 data_1.to_excel('outputfile',engine='openpyxl')
32 # data_1.to_excel(outputfile, "a+")
33
34 # l = ['x1','x3','x4','x5','x6','x7','x8','x13']
(...)
46 # new_reg_data['y'] = y
47 # new_reg_data.to_excel(outputfile)

ValueError: Length of values (22) does not match length of index (20)

这个错误应该怎么解决?谢谢

你看你代码得29行,你得值长度22,但是索引只有20,发生不匹配得错误