You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following solution, y equation does not reflect the printed statements
Use the linear equation you’ve just created to predict life expectancy in Germany for every year between 2001 and 2016. How accurate are your answers? If you worked for a pension scheme would you trust your answers to predict the future costs for paying pensioners?
Given solution --
df = pd.read_csv('../data/gapminder-life-expectancy.csv',index_col="Life expectancy")
for x in range(2001,2017):
y = 0.215621719457 * x - 351.935837103
real = df.loc['Germany', str(x)]
print(x, "Predicted", y, "Real", real, "Difference", y-real)
y equation should be
y=0.212219909502 * x - 346.784909502
df = pd.read_csv('../data/gapminder-life-expectancy.csv',index_col="Life expectancy")
for x in range(2001,2017):
y=0.212219909502 * x - 346.784909502
real = df.loc['Germany', str(x)]
print(x, "Predicted", y, "Real", real, "Difference", y-real)
please review, thanks
Zekai Otles
Thanks for contributing! If this contribution is for instructor training, please send an email to [email protected] with a link to this contribution so we can record your progress. You’ve completed your contribution step for instructor checkout just by submitting this contribution.
If this issue is about a specific episode within a lesson, please provide its link or filename.
Please keep in mind that lesson maintainers are volunteers and it may be some time before they can respond to your contribution. Although not all contributions can be incorporated into the lesson materials, we appreciate your time and effort to improve the curriculum. If you have any questions about the lesson maintenance process or would like to volunteer your time as a contribution reviewer, please contact Kate Hertweck ([email protected]).
The text was updated successfully, but these errors were encountered:
In the following solution, y equation does not reflect the printed statements
Use the linear equation you’ve just created to predict life expectancy in Germany for every year between 2001 and 2016. How accurate are your answers? If you worked for a pension scheme would you trust your answers to predict the future costs for paying pensioners?
Given solution --
df = pd.read_csv('../data/gapminder-life-expectancy.csv',index_col="Life expectancy")
for x in range(2001,2017):
y = 0.215621719457 * x - 351.935837103
real = df.loc['Germany', str(x)]
print(x, "Predicted", y, "Real", real, "Difference", y-real)
y equation should be
y=0.212219909502 * x - 346.784909502
df = pd.read_csv('../data/gapminder-life-expectancy.csv',index_col="Life expectancy")
for x in range(2001,2017):
y=0.212219909502 * x - 346.784909502
real = df.loc['Germany', str(x)]
print(x, "Predicted", y, "Real", real, "Difference", y-real)
please review, thanks
Zekai Otles
Thanks for contributing! If this contribution is for instructor training, please send an email to [email protected] with a link to this contribution so we can record your progress. You’ve completed your contribution step for instructor checkout just by submitting this contribution.
If this issue is about a specific episode within a lesson, please provide its link or filename.
Please keep in mind that lesson maintainers are volunteers and it may be some time before they can respond to your contribution. Although not all contributions can be incorporated into the lesson materials, we appreciate your time and effort to improve the curriculum. If you have any questions about the lesson maintenance process or would like to volunteer your time as a contribution reviewer, please contact Kate Hertweck ([email protected]).
The text was updated successfully, but these errors were encountered: