Life Expectancy and GDP

Hi everyone,

please kindly check my project on Life Expectancy and GDP:

Any feedback is welcome!

Thanks in advance!

Hi Lorenzo
I’ve checked your project and looks great, a couple of suggestions for the future:

  • You are the only one setting boundaries for yourself so next time you are working on a project, I encourage you to go deeper in your analysis, you can explore way more with also different approaches and styles for plotting. I think this will help you a lot.
  • The second and I think the most important one is that in question 3, it seems like you wrote a lot of code and all of it was the same repeated over and over again. I understand that it is really tempting to do this when you don’t have much confidence in your capabilities using different loops. Maybe the next time you can try to challenge yourself and write a function or loop that does this thing for you instead.

This is what I wrote for that particular plot, I know it can be better but I am on the same path as you so there is a lot of space for growth.

Code:

colors = [‘blue’, ‘gray’, ‘red’, ‘lightblue’, ‘purple’, ‘pink’]
countries = list(life_gdp_df.Country.unique())
plt.figure(figsize=(20,10))
for i in range(6):
plt.subplot(2,3,i+1)
x = list(life_gdp_df.Life_expectancy[life_gdp_df.Country == countries[i]])
y = list(life_gdp_df.GDP[life_gdp_df.Country == countries[i]])
plt.scatter(x, y, color = colors[i])
plt.title(countries[i] + ’ Life expectancy over GDP’)
plt.xlabel(‘Life expectancy’)
plt.ylabel(‘GDP’)

hi arquimides23,

Thanks a lot for contributing to my project!

Best regards,
Lorenzo

Why is greater LEABY in Chile than in US a surprise?