{ "cells": [ { "cell_type": "code", "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { "end_time": "2024-06-08T09:52:47.287637Z", "start_time": "2024-06-08T09:52:46.348111Z" } }, "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import pandas as pd" ], "outputs": [], "execution_count": 1 }, { "metadata": { "ExecuteTime": { "end_time": "2024-06-08T09:53:28.061215Z", "start_time": "2024-06-08T09:53:28.039931Z" } }, "cell_type": "code", "source": [ "df = pd.read_csv(\"./data/world-happiness-report-2017.csv\")\n", "df.head(10)" ], "id": "613252be66c5c97d", "outputs": [ { "data": { "text/plain": [ " Country Happiness.Rank Happiness.Score Whisker.high Whisker.low \\\n", "0 Norway 1 7.537 7.594445 7.479556 \n", "1 Denmark 2 7.522 7.581728 7.462272 \n", "2 Iceland 3 7.504 7.622030 7.385970 \n", "3 Switzerland 4 7.494 7.561772 7.426227 \n", "4 Finland 5 7.469 7.527542 7.410458 \n", "5 Netherlands 6 7.377 7.427426 7.326574 \n", "6 Canada 7 7.316 7.384403 7.247597 \n", "7 New Zealand 8 7.314 7.379510 7.248490 \n", "8 Sweden 9 7.284 7.344095 7.223905 \n", "9 Australia 10 7.284 7.356651 7.211349 \n", "\n", " Economy..GDP.per.Capita. Family Health..Life.Expectancy. Freedom \\\n", "0 1.616463 1.533524 0.796667 0.635423 \n", "1 1.482383 1.551122 0.792566 0.626007 \n", "2 1.480633 1.610574 0.833552 0.627163 \n", "3 1.564980 1.516912 0.858131 0.620071 \n", "4 1.443572 1.540247 0.809158 0.617951 \n", "5 1.503945 1.428939 0.810696 0.585384 \n", "6 1.479204 1.481349 0.834558 0.611101 \n", "7 1.405706 1.548195 0.816760 0.614062 \n", "8 1.494387 1.478162 0.830875 0.612924 \n", "9 1.484415 1.510042 0.843887 0.601607 \n", "\n", " Generosity Trust..Government.Corruption. Dystopia.Residual \n", "0 0.362012 0.315964 2.277027 \n", "1 0.355280 0.400770 2.313707 \n", "2 0.475540 0.153527 2.322715 \n", "3 0.290549 0.367007 2.276716 \n", "4 0.245483 0.382612 2.430182 \n", "5 0.470490 0.282662 2.294804 \n", "6 0.435540 0.287372 2.187264 \n", "7 0.500005 0.382817 2.046456 \n", "8 0.385399 0.384399 2.097538 \n", "9 0.477699 0.301184 2.065211 " ], "text/html": [ "
\n", " | Country | \n", "Happiness.Rank | \n", "Happiness.Score | \n", "Whisker.high | \n", "Whisker.low | \n", "Economy..GDP.per.Capita. | \n", "Family | \n", "Health..Life.Expectancy. | \n", "Freedom | \n", "Generosity | \n", "Trust..Government.Corruption. | \n", "Dystopia.Residual | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "Norway | \n", "1 | \n", "7.537 | \n", "7.594445 | \n", "7.479556 | \n", "1.616463 | \n", "1.533524 | \n", "0.796667 | \n", "0.635423 | \n", "0.362012 | \n", "0.315964 | \n", "2.277027 | \n", "
1 | \n", "Denmark | \n", "2 | \n", "7.522 | \n", "7.581728 | \n", "7.462272 | \n", "1.482383 | \n", "1.551122 | \n", "0.792566 | \n", "0.626007 | \n", "0.355280 | \n", "0.400770 | \n", "2.313707 | \n", "
2 | \n", "Iceland | \n", "3 | \n", "7.504 | \n", "7.622030 | \n", "7.385970 | \n", "1.480633 | \n", "1.610574 | \n", "0.833552 | \n", "0.627163 | \n", "0.475540 | \n", "0.153527 | \n", "2.322715 | \n", "
3 | \n", "Switzerland | \n", "4 | \n", "7.494 | \n", "7.561772 | \n", "7.426227 | \n", "1.564980 | \n", "1.516912 | \n", "0.858131 | \n", "0.620071 | \n", "0.290549 | \n", "0.367007 | \n", "2.276716 | \n", "
4 | \n", "Finland | \n", "5 | \n", "7.469 | \n", "7.527542 | \n", "7.410458 | \n", "1.443572 | \n", "1.540247 | \n", "0.809158 | \n", "0.617951 | \n", "0.245483 | \n", "0.382612 | \n", "2.430182 | \n", "
5 | \n", "Netherlands | \n", "6 | \n", "7.377 | \n", "7.427426 | \n", "7.326574 | \n", "1.503945 | \n", "1.428939 | \n", "0.810696 | \n", "0.585384 | \n", "0.470490 | \n", "0.282662 | \n", "2.294804 | \n", "
6 | \n", "Canada | \n", "7 | \n", "7.316 | \n", "7.384403 | \n", "7.247597 | \n", "1.479204 | \n", "1.481349 | \n", "0.834558 | \n", "0.611101 | \n", "0.435540 | \n", "0.287372 | \n", "2.187264 | \n", "
7 | \n", "New Zealand | \n", "8 | \n", "7.314 | \n", "7.379510 | \n", "7.248490 | \n", "1.405706 | \n", "1.548195 | \n", "0.816760 | \n", "0.614062 | \n", "0.500005 | \n", "0.382817 | \n", "2.046456 | \n", "
8 | \n", "Sweden | \n", "9 | \n", "7.284 | \n", "7.344095 | \n", "7.223905 | \n", "1.494387 | \n", "1.478162 | \n", "0.830875 | \n", "0.612924 | \n", "0.385399 | \n", "0.384399 | \n", "2.097538 | \n", "
9 | \n", "Australia | \n", "10 | \n", "7.284 | \n", "7.356651 | \n", "7.211349 | \n", "1.484415 | \n", "1.510042 | \n", "0.843887 | \n", "0.601607 | \n", "0.477699 | \n", "0.301184 | \n", "2.065211 | \n", "