Python is open source and it has a lot of libraries. So there are a lot of deep-rooted fans about Python in all over the world. it will be as popular as R and MySQL in the data analysis area.

I tried to express the transition of the population of India with a heat map by Python.

My coding environment is Python3 + Jupyter Notebook, Windows.

About Data

I used data from Wikipedia’s Indian population.

Reffer:List of states in India by past population(Wikipedia)

Population data for each state is available every 10 years from 1951 to 2011 . And 2019.

The center of each state (the center of the heatmap circle) is the location of the state capital or the appropriate coordinates within that state.

There are some states where weren’t in India before, but I haven’t considered it in detail because the main theme is to create heatmaps in Python.

Code

As usually I installed library

Then I installed Data.
This time, I installed the CSV data of population and latitude / longitude created from Data in Wikipedia.

Next I calculated the percentage of the population in each state each year.

Finally, I put the data on the map.

This is a result.

Yeh cute hain.

The problem with this figure is that it is a yearly ratio of each states so even if the population is increasing , it will not be displayed as increased (more red) in the above figure unless the population ratio in India is increasing.

For example, the population of Maharashtra, where Bombay is located, was 32,002,500 in 1951 and 123,144,223 in 2019, a nearly four-fold increase. (I’m surpsised at The population of Maharashtra is as many as Whole Japan!)

the redness of Maharashtra has not changed so much.
Beacause the population growth of Maharashtra is not so much ,compared to the population growth of India as a whole.

Also, because Delhi is so much crowded in India, so Delhi is bright red and other cities are less noticeable.

CHIDA BEAGLE SOLUTIN is also working on the data visualization of such data. Please feel free to contact us if you have any questions!

Leave a Reply

Your email address will not be published. Required fields are marked *