Visual representation of data is most important aspect of presenting views to customers or layman. Doing data analysis with Python is quite easy with help of packages like Pandas and Matplotlib.
For Map Visualization, one needs Basemap.
I recommend using Anaconda for Data Analysis purposes due to its simplicity of package installation. One needs to install basemap using simple command in Command Terminal.
- conda install basemap
This command will install basemap and required dependencies will be installed or updated.
For map, we needs basic thing like latitude and longitude with box details around map.Here we are going to use India (obviously).This information can be obtained by this Boundingbox. Search “India” in search box at top left
Now on lower corner left hand side from drop down list select “Dublin Core”. Lower center will show ” westlimit=68.11; southlimit=6.55;eastlimit=97.4;northlimit=35.67″.
Westlimit and Southlimit togther are “lower left corner” while eastlimit and northlimit are “upper right corner”. (If you full Map of India i.e with all of Jammu and Kashmir northlimit will be 37.)
First import packages :
Now data to visualize
You can get Aadhar Saturation data from state-wise-aadhaar-saturation. You need to extract pdf tables into csv. To match shape files (Diva-GIS) you need to check state names with India_adm1.csv file.
Now map creation and add shapefile
This is fairly explanatory. Basemap arguments contain resolution which is set to c i.e crude, llcrnrlon = westlimit = 68, llcrnrlat= southlimit=6, urcrnrlon= eastlimit=97 and urcrnrlat=northlimit=35 or 37. lat_0 and lon_0 are for centre point of map. We read shapefile from India_adm1 which consist state boundaries.
This is how crude map looks like. We still aren’t done.Plotting points are done by
Dataframes bind areas and respected saturation values together. Now we need to add color and set resolution.
Finally , the output is this.
You can download code from here.