The Happiness Report¶

Although it is sometimes neglected in our everyday life, happiness is extremely important. Your happiness not only affects the mind but also the body. Happiness lowers stress hormones, helps ease anxiety and depression, and improves our immune system. Happiness is seen in all aspects of life, therefore it is important to analyze. According to the World Happiness Report, general happiness in US adults has decreased over the years. With all the stress of the world, many forget to find happiness in their lives.

image.png https://worldhappiness.report/ed/2019/the-sad-state-of-happiness-in-the-united-states-and-the-role-of-digital-media/

Each country has its own way of supporting its citizens, which contributes to how happy the population is. Countries around the world are looking at happiness as an indicator of national well-being and considering happiness in policy making. By looking at how the people are treated in each country, we can figure out what increases and decreases happiness in a person.

To explore more about the issue of happiness in the world, visit the following articles:¶

https://news.gallup.com/opinion/gallup/401216/global-rise-unhappiness.aspx

https://www.latimes.com/science/sciencenow/la-sci-sn-americans-less-happy-20190323-story.html

https://worldhappiness.report/ed/2019/the-sad-state-of-happiness-in-the-united-states-and-the-role-of-digital-media/

The Dataset¶

This dataset is provided by the World Happiness Project. It ranks each country based on its citizens' happiness and evaluates each country's GDP, social support, health, and freedom.

In [14]:
import pandas as pd

df_rankings = pd.read_csv('rankings.csv')
df_rankings.head()
Out[14]:
RANK Country Happiness score Whisker-high Whisker-low Dystopia (1.83) + residual Explained by: GDP per capita Explained by: Social support Explained by: Healthy life expectancy Explained by: Freedom to make life choices Explained by: Generosity Explained by: Perceptions of corruption
0 1 Finland 7.821 7.886 7.756 2.518 1.892 1.258 0.775 0.736 0.109 0.534
1 2 Denmark 7.636 7.710 7.563 2.226 1.953 1.243 0.777 0.719 0.188 0.532
2 3 Iceland 7.557 7.651 7.464 2.320 1.936 1.320 0.803 0.718 0.270 0.191
3 4 Switzerland 7.512 7.586 7.437 2.153 2.026 1.226 0.822 0.677 0.147 0.461
4 5 Netherlands 7.415 7.471 7.359 2.137 1.945 1.206 0.787 0.651 0.271 0.419

The Data Dictonary¶

A Data Dictionary is a collection of names, definitions, and attributes about data elements that are being used or captured in a database. This data dictonary explains my dataframe df_rankings.

In [20]:
variables = list(df_rankings.keys())

data = [['RANK', 'int', 'Rank of happiness compared to all countries'], 
        ['Country', 'str', 'Name of country'],
        ['Happiness score', 'float', 'Happiness score of country'],
        ['Whisker-high', 'float', ' The maximum value of the data set'],
        ['Whiskerr-low', 'float', 'The minimum value of the data set'],
        ['Dystopia', 'float', 'The estimated extent to which all other variables fail to explain the Happiness Score'],
        ['Explained by: GDP per capital', 'float', 'Estimated extent to which GDP explains the Happiness Score'],
        ['Explained by: Social support', 'float', 'Estimated extent to which Social support explains the Happiness Score'],
        ['Explained by: Healthy life expectancy', 'float', 'Estimated extent to which Healthy life expectancy explains the Happiness Score'],
        ['Explained by: Freedom to make life choices', 'float', 'Estimated extent to which Freedom explains the Happiness Score'],
        ['Explained by: Generosity', 'float', 'Estimated extent to which Generosity explains the Happiness Score'],
        ['Explained by: Perceptions of corruption', 'float', 'Estimated extent to which Perceptions of corruption explains the Happiness Score']
       ]
data_dict = pd.DataFrame(data, columns=['Column', 'Data Type', 'Description'])
pd.set_option('display.max_colwidth', None)
data_dict
Out[20]:
Column Data Type Description
0 RANK int Rank of happiness compared to all countries
1 Country str Name of country
2 Happiness score float Happiness score of country
3 Whisker-high float The maximum value of the data set
4 Whiskerr-low float The minimum value of the data set
5 Dystopia float The estimated extent to which all other variables fail to explain the Happiness Score
6 Explained by: GDP per capital float Estimated extent to which GDP explains the Happiness Score
7 Explained by: Social support float Estimated extent to which Social support explains the Happiness Score
8 Explained by: Healthy life expectancy float Estimated extent to which Healthy life expectancy explains the Happiness Score
9 Explained by: Freedom to make life choices float Estimated extent to which Freedom explains the Happiness Score
10 Explained by: Generosity float Estimated extent to which Generosity explains the Happiness Score
11 Explained by: Perceptions of corruption float Estimated extent to which Perceptions of corruption explains the Happiness Score

Using data science, we can find patterns in the relation of happiness in countries and how their health, social support, and government freedom affects happiness. We'll sort the countries by who has the highest scores in each category and assess how their ranking is affected by the category.

In [ ]: