Working with geospatial data
For our last case study, let us explore the analysis of geospatial data using an extension to the Pandas library, GeoPandas. You will need to have GeoPandas installed in your IPython environment to follow this example. If it is not already installed, you can add it using easy_install
or pip.
Loading geospatial data
In addition to our other dependencies, we will import the GeoPandas
library using the command:
>>> import GeoPandas as geo.
We load dataset for this example, the coordinates of countries in Africa ("Africa." Maplibrary.org. Web. 02 May 2016. http://www.mapmakerdata.co.uk.s3-website-eu-west-1.amazonaws.com/library/stacks/Africa/) which are contained in a shape (.shp
) file as before into a GeoDataFrame, an extension ...
Get Mastering Predictive Analytics with Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.