' b- B1 @& S1 q/ S- ]" R12.绘制预测曲线:: c; G! g. p9 W) P. g
8 F7 I D) a3 t8 }( P' F, }! M
year = np.linspace(1790, 2000, 21) A9 ?. b z8 w population = [x(each, r, xm) for each in year]# X- [( U% |: i
plt.scatter(df['year'], df['population'], label='actual')7 L- T6 G; ^+ {! `
plt.plot(year, population, label='predict', color='coral')0 w9 L U+ J2 C) f& X
plt.legend()( ^! A' l5 P% s$ F p7 w