Displaying geographical maps

Whether dealing with local of global data, geographical maps are a suitable visualization. To plot data on a map, we need coordinates, usually in the form of latitude and longitude values. Several file formats exist with which we can save geographical data. In this recipe, we will use the special shapefile format and the more common tab separated values (TSV) format. The shapefile format was created by the Esri company and uses three mandatory files with the extensions .shp , .shx , and .dbf. The .dbf file contains a database with extra information for each geographical location in the shapefile. The shapefile we will use contains information about country borders, population, and Gross Domestic Product (GDP). We ...

Get Python Data Analysis Cookbook 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.