December 2018
Beginner to intermediate
682 pages
18h 1m
English
Let's begin by looking at the steps to import an online CSV file as a pandas DataFrame. In this example, we are going to use the annual population summary published by the Department of Economic and Social Affairs, United Nations, in 2015. Projected population figures towards 2100 were also included in the dataset:
import numpy as np # Python scientific computing packageimport pandas as pd # Python data analysis package# URL for Annual Population by Age and Sex - Department of Economic# and Social Affairs, United Nationssource = "https://github.com/PacktPublishing/Matplotlib-2.x-By-Example/blob/master/WPP2015_DB04_Population_Annual.zip"# Pandas support both local or online files data = pd.read_csv(source, ...