
On the side of my full-time job because the CEO of a small machine-learning company, my hobby is creating beautiful data visualizations.
I normally do this using Matplotlib, but I desired to create a more interactive experience this time.
Since I enjoy web development and design, I made a decision to create a React application for the Population Estimates And Projections dataset from the World Bank.
It’s an interesting dataset where you may take a look at population pyramids for all countries and regions from 1960 to 2022, including projections to 2050. It’s licensed under Creative Commons Attribution 4.0.
It’s also a dataset well fitted to an interactive interface where people can change years and regions quickly.
On this story, I’ll share insights from my work and what I learned.
If you should test the answer, you will discover it here: https://datawonder.io/population-pyramids
Let’s start.
I desired to create a straightforward and fast backend that serves data to the front end without doing any time-consuming preprocessing.
As a substitute, my idea was to do all the information ahead of time and cargo all of it into memory when the applications start.
The World Bank data all the time have a set of indicators, and those I would like have the next format:
Population ages
,
There are 17 age groups starting from 0–4 and 80+. Each indicator has a separate column for each 12 months, like within the pandas data frame below.
Since I knew exactly what parts of the information I needed and didn’t wish to do any filtering or other operations…