# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()

# !ls

df=pd.read_csv("world-happiness-report-2019.csv")
df

df.info()

df.corr()

plt.figure(dpi=120)
sns.heatmap(df.corr())

df.corr()["Ladder"]

df.corr()["Ladder"][1:]

df.corr()["Ladder"][1:].sort_values()

df.corr()["Ladder"][1:].sort_values(ascending=False)

df.mean()

df[df["Country (region)"]=="India"]

df.iloc[:5,:]

top5=df.iloc[:5,:].mean()
top5

india=df[df["Country (region)"]=="India"].squeeze()[1:]
india

df1=pd.DataFrame({"top5":top5,"India":india})
df1

df1["Difference"]=df1["top5"]-df1["India"]
df1



StarcoderdataJupyterScriptsDedupFiltered