import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("HEALTH_LVNG_13092016124120389.csv")[["Country", "Year", "Value"]]
mean = df[["Country", "Value"]].groupby("Country", sort=False).mean()
mean.columns = ["Mean"]
mean["Rank"] = mean.rank(ascending=False).astype(int)
mean = mean.sort_values(by="Mean", ascending=False).reset_index()
mean[["Rank", "Country", "Mean"]]
import cufflinks as cf
cf.go_offline()
top = df.merge(mean[0:15], on="Country").pivot(values="Value", columns="Country", index="Year")
top.iplot(kind='scatter', title="Alcohol consumption per capita", xTitle="Year", yTitle="L of ethanol / person")