import pandas as pd
#读取文件
df = pd.read_csv(r'C://Users//dxz//python_learning//data//women.csv')
import statsmodels.api as sm
#设置x,y
x = sm.add_constant(df['height'])
y = df['weight']
#训练模型
model = sm.OLS(y, x).fit()
model.summary()
#预测
pred = model.predict(x)