5. Plotting Geospatial Data
Activity 5.01: Plotting Geospatial Data on a Map
Solution:
Let's plot the geospatial data on a map and find the densely populated areas of cities in Europe that have population of more than 100,000:
- Create an
Activity5.01.ipynb
Jupyter notebook in theChapter05/Activity5.01
folder to implement this activity and then import the necessary dependencies:import numpy as np import pandas as pd import geoplotlib
- Load the
world_cities_pop.csv
dataset from theDatasets
folder using pandas:#loading the Dataset (make sure to have the dataset downloaded) dataset = pd.read_csv('../../Datasets/world_cities_pop.csv', \                       dtype = {'Region': np.str})
Note
If we import our dataset without defining the
dtype
attribute of theRegion
column as aString
type, we will get a warning telling us that...