# ---
# 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 matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd

df_can = pd.read_csv('canada.csv', encoding = "ISO-8859-1")

df_can.sort_values(['Total'], ascending=False, axis=0, inplace=True)

top_5_countries = df_can.head()

years = list(map(str, range(1980, 2014)))

top_5_countries.index = top_5_countries.iloc[:, 0]

top_5_countries = top_5_countries[years].transpose()

top_5_countries.plot(kind='area')
plt.title('Immigration trend of  top 5 countries')
plt.ylabel('Number of immigrants')
plt.xlabel('Years')



StarcoderdataJupyterScriptsDedupFiltered