City of Barcelona

Barcelona

Sourin Karmakar
7 min readSep 20, 2019

--

Exploring the city

Recently I came across this Barcelona dataset which actually can tell us a lot about the city. In this blog, I would just like to do some exploratory analysis in order to find out some information that this dataset provides. This blog will contain several visualisations and some explanation about what I perceived from those visualisations.

About the datasets

For this exploration, the dataset I used, is available in Kaggle click here.

This is a set of datasets which deals with population, immigration, emigration, accidents, transportation, unemployment, baby names etc.

About Barcelona

Barcelona is a city in Spain. It is located in Catalonia and it also the capital of community of Catalonia. This city lies on the coast of Mediterranean sea and has an area of 101 sq. km. This city is second most populous in Spain.

The entire city is divided into ten districts.

Map of Barcelona with its districts

Population in Barcelona

For the analytics purpose first I have considered the population dataset which gives the data on population from year 2013–2017.

Population trend 2013–2017 in Barcelona

So from this chart one can easily make out that the population of Barcelona is increasing over years. Line chart is effective in communicating the trend over years as it gives us a feel of continuity and also representing the continuity of time.

But as one can see that the population decreases rapidly during 2013–2014 and then increases with a good rate thereafter.

Population of Barcelona Gender wise

Male population trend in Barcelona 2013–2017
Female population trend in Barcelona 2013–2017

Gender wise the population showed similar trend and also it has been observed that female population is more in Barcelona than male population.

But by how much the population for each gender is increasing or decreasing?

Difference graph of male and female population

This bar graph is the difference graph showing the population difference between the current year and previous year.

  • From here one can easily check out that male population in 2013 to 2014 decreased more than female population
  • During 2016–2017 the female population increased more than male population.
  • It also gives a clear trend that the population is increasing every year from 2014 with a good rate (Not a linear increment).

Population district wise

Here is a table that represents the population of the Barcelona city during 2013–2017 for each district.

The values given in the table are the percentage population of the Barcelona for each year.

Percentage of population year and district wise (2013–2017) in Barcelona

Analysis

  • The most populous district of the Barcelona is Eixample consisting around 16% of the Barcelona’s population. In the map of Barcelona we have observed that Eixample is like the city centre so that may be the reason why the population is more there.
  • Les Corts id the least populous district consisting only around 5% of the entire Barcelona's population.
  • No big changes can be seen over the years in the population of the districts.

I chose a table for representing this information because it can convey the percentage population of each District for each of the years more precisely and also comparing this information year-wise or district wise will be easy. It efficiently expresses the big picture at one place.

Lets see some interesting trends and try to analyse them.

Population trend for district Sarria Sant Gervasi(Barcelona)

In this graph we can see that the population of Sarria-Sant Gervasi is increasing with a constant rate even though we have seen the population has drastically reduced during 2013–2014.

The reasons according to me after a small amount of research may be :

  • Google map shows that this district is in the extreme north of the city and is a hilly area where the population density is less in comparison to other districts. So people may be shifting to this place as it is much away from the city and also it is not so densely populated.

Population of Barcelona Age group wise

Population distribution graph (Age group wise) in Barcelona — 2017

This is a chart representing the population distribution with respect to Age for year 2017 and from this we can see that

  • Most the Barcelona population is in between the age group 25–65, indicating the working class.
  • The most populated age group is 35–39.
  • The no.of youth and adult people are more in Barcelona.

The Spark lines along with a table shows the year wise trend of all the age wise group of population

Some insights from this sparkline table

  • We can see a decreasing trend in the population between age group 30 to 39
  • We can also observe that the population with age group between 10 to 30 is increasing.
  • There is a decreasing trend in the population of age group 0–4.
  • There is an increasing trend for the population with age group 85+.

These are some of the insights that I have drawn from the Barcelona population data and I hope that the data about population has given a lot of information about Barcelona’s population distribution and trend.

Now as going through the population data I thought let’s see what is there in the birth and death dataset which may give us some more insights into the previous dataset we saw and also we may discover some new patterns.

Births and Deaths in Barcelona

Let us start with the Births in Barcelona. The data set consists data from year 2013 to 2017.

The trend of this graph shows that there is a linear increment in the no.of births between year 2013 to 2016 but there is a slight negative trend in 2017. But overall we can see that there is increasing trend throughout.

Births in Barcelona Gender wise

This graph above shows that

  • The no.of boys taking birth is always more than the no.of girls taking birth.
  • The trend for boys taking birth is increasing but there is no sudden increase or decrease in the trend.
  • In case of no.of births of girls the trend is increasing with a much faster rate than boys and it was at maximum in year 2016 but there is sudden fall in 2017.
  • In 2016 the no.of girls took birth increases rapidly whereas the no.of boys took birth in that year showed a negative trend.

Now let’s look at the no.of births of girl to no.of births of boy ratio

From the above chart we can see that the ratio between no.of births of girls to no.of births of boys is always less than 1 but not less than 0.9 (precisely : 0.93) which means that there is no significant difference in the percentage of boys and girls taking birth (usually it 50% boys and 50% girls with a deviation of 1%) but we can see that in year 2016 this ratio was the best (0.97).

Births in Barcelona by Districts

Image of comparative study of trend of births by district year wise

Is there any relationship between the population of districts and no.of births in district? For this I have considered only 2017 data and tried to scatter the data and then plotted a trend line.

This correlation plot shows a clear linear trend with R square value of 0.98 means that the no.of births are completely depends on the population of the district.

Deaths in Barcelona

The data provided for the deaths in Barcelona is for three years i.e. from 2015–2017.

Even though the data is presented for only three years but the no.of deaths seemed to increased in 2017 than 2016.

Now we would like to know which age-group of population is dying more in Barcelona.

From the above distribution graph for 2017 data, it is obvious that more of the people above age 60 are dying more and other graphs for year 2015, 2016 also showed the similar trend. It was found out that out of all deaths in year 2017, 93% people were above 60 years old. So we can conclude that most of the people die a natural death in Barcelona.

Now let’s compare the no.of deaths in Barcelona in 2016 and 2017 district wise

From the above graphs we can observe that Eixample is leading in the no.of deaths in both the years and showing other districts showing a similar trend.

Now similar question arises in mind, we have seen that population of Eixample is more so deaths are also more? Let’s see the population and no.of deaths are correlated or not?

And Yes! this too depends on the population of the Districts.

So these datasets on population, birth and death gives us a lot of insights about the city.

--

--