For data scientists, data visualization is a very important step to show some useful insights. Not only bar charts, line graphs, and scatter plots are useful, but also maps are very helpful to know our data better. In this blog, I will share my experience of plotting a map of India using GeoPandas.
What is Geopandas?
GeoPandas is an open-source project to make working with geospatial data in python easier. In my opinion, GeoPandas is one of the most satisfying Python packages to use because it produces a tangible, visible output that is directly linked to the real world. Here we will be exploring the method to create a geo map and visualize data over it, using shapefiles(.shp) and some other Python libraries.
I strongly encourage you to look at the official documentation, to see all the cool things GeoPandas is capable of. Hopefully, you find this tutorial helpful and exciting! All of the relevant data and notebooks can be found on my GitHub page here.
Let’s begin…
Step 1 : Installing GeoPandas and Shapely
This instruction assumes that you have Anaconda Navigator installed on your machine and use either Jupiter Notebook or Spyder IDE for python development. We will need to install the GeoPandas and Shapely libraries in order to plot a map, and these libraries do not come with the Anaconda download.
There are two ways to install GeoPandas, the recommended way, as per the documentation (available at http://geopandas.org) is through the conda-forge channel with the following command from your terminal:
conda install -c conda-forge geopandas
or alternatively
pip install geopandas
Be sure to add an ! to if pip installing from a jupyter notebook or Spyder IDE.
imku