为什么编码会出现错误?

import pandas as pd
 import numpy as np 
import matplotlib.pyplot as plt 
from sklearn import datasets,linear_model
 #读取数据函数 
def get_data(file_name):    
 data=pd.read_csv(file_name)#读取csv文件    
 X_parameter=[]     
Y_parameter=[]     
for single_square_feet,single_price_value in zip(data['square_feet'],data['price']):#遍历数据         
X_parameter.append([float(single_square_feet)])#存储在相应的list列表中        
 Y_parameter.append(float(single_price_value))#存储在相应的;ist列表中    
 return X_parameter,Y_parameter #将数据拟合到线性模型 
def linear_model_main(X_parameter,Y_parameter,predict_value):    
 regr=linear_model.LinearRegression()    
 regr.fit(X_parameter,Y_parameter)#训练模型     
predict_outcome=regr.predict(predict_value)    
 predictions={}     
predictions['intercept']=regr.intercept_     
predictions['coefficient']=regr.coef_     
predictions['predicted_value']=predict_outcome     
return predictions X,Y=get_data('input_data.csv') 
predictvalue=700 
result=linear_model_main(X,Y,predictvalue) 
print("Intercept value ",result['intercept'])
 print("coefficient",result['coefficient']) 
print("Predicted value: ",result['predicted_value']) #显示线性拟合模型的结果
 def show_linear_line(X_parameters,Y_parameters):    
 regr=linear_model.LinearRegression()     
regr.fit(X_parameters,Y_parameters)     
plt.scatter(X_parameters,Y_parameters,color='blue')     
plt.plot(X_parameters,regr.predict(X_parameters),color='red',linewidth=4)    
 plt.xticks()     
plt.yticks()    
plt.show() 、
show_linear_line(X,Y)

错误:

img

 文件内容:

img

请各位帮忙看一下为什么会这样?

csv文件编码不是utf8, read_csv用gb2312编码试试