Practice Plotting with Pandas by analyzing Happiness
Practice Plotting with Pandas by analyzing Happiness Data Science Project
Intro to Pandas for Data Analysis

Practice Plotting with Pandas by analyzing Happiness

In this project you'll practice how to create different visualizations like boxplots, line charts, histograms, etc using a Dataset containing a Happiness report from the World Happiness Report foundation. You'll do it directly from a pandas Dataframe using the `.plot` method, extremely convenient and powerful. You'll also learn the underlying details of the plotting library used by Pandas: matplotlib.

Project Activities

All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.

All our activities include solutions with explanations on how they work and why we chose them.

codevalidated

Load the data

Load the world_happiness.csv and store its data in a df variable.

codevalidated

Create a histogram showing the distribution of happiness score

Create your histogram and, when ready, save it to a happiness_hist variable and validate it with the following button.

Your code should look like:

happiness_hist = df["Happiness score"].plot(.......

Important! we'll interactively check that your variables happiness_hist contain the correct information

codevalidated

Create a horizontal bar chart with the combined top 10 and bottom 10 countries

Create your horizontal bar chart and, when ready, save it to a happiness_gap_chart variable and validate it with the following button.

Your code should look like:

happiness_gap_chart = pivot_df.plot(.......)

Important! we'll interactively check that your variable happiness_gap_chart contain the correct information

codevalidated

Create a horizontal bar chart with the combined top 5 and bottom 5 countries sorted by generosity

Create your horizontal bar chart and, when ready, save it to a generosity_gap_chart variable and validate it with the following button.

Your code should look like:

generosity_gap_chart = generosity_pivot_df.plot(.......)

Important! we'll interactively check that your variable generosity_gap_chart contain the correct information

codevalidated

Create a pie chart showing the proportion of GDP and health life in the happiness contribution

Create your pie chart and, when ready, save it to a GDP_vs_health_pie variable and validate it with the following button.

Your code should look like:

GDP_vs_health_pie = GDP_vs_health_percent.plot(.......)

Important! we'll interactively check that your variables GDP_vs_health_pie contain the correct information

codevalidated

Create a pie chart showing the proportion of each factor in the happiness contribution

Create your pie chart and, when ready, save it to a factors_pie variable and validate it with the following button.

Your code should look like:

factors_pie = factors_percent.plot(.......)

Important! we'll interactively check that your variables factors_pie contain the correct information

codevalidated

Create a horizontal stacked bar chart showing contribution of each factor in happoiness of top 10 happiest countries

Create your horizontal stacked bar chart and, when ready, save it to a top_10_factors_contribution_chart variable and validate it with the following button.

Your code should look like:

top_10_factors_contribution_chart = top_10_factors.plot(.......)

Important! we'll interactively check that your variables top_10_factors and top_10_factors_contribution_chart contain the correct information

Practice Plotting with Pandas by analyzing HappinessPractice Plotting with Pandas by analyzing Happiness
Author

Mohamed Rawash

This project is part of

Intro to Pandas for Data Analysis

Explore other projects