An investigation into the demographics of the different districts of Copenhagen and their respective voting behaviour
over the last 10 years.14th of May, 2018
Explainer Page
Data Collection
For this project, data was collected from multiple different locations using Python. First, a historical dataset on socio econmic status of all districts of the Copenhagen municipality was taken from opendata.dk.
This set contains data from 2008 till 2014 on all sorts of socio economic stats like age distribution and how many people work in different sectors. The data was divided by 'rodes' (small subdivisions of districts used for taxes) and we wanted to
work on districts, so another data set was taken from the
portal to convert all rows into their districts. The data was then grouped on district and year with Pandas and a district_id was added for easy reference, since the spelling of
Danish brings a lot of character encoding issues. A geojson file was then used to create a map of the districts. Since non of our group members are Danish, quite some time went into translating
all variables into English. The final dataset contianed 70 rows (10 districts for 7 years) and 67 columns. Only the counts (and not the ratios) were kept because we had to group all the original 'rodes'.
Then, voting data on two municipal elections (2013 & 2017) was scraped from the official result website. The page for Copenhagen has the results from every voting office linked below. It was clear that
all these pages had similar urls, with only the last two digits changing, ranging from 1 to 55. On every page there was the same table with the number of votes per party which could easily be parsed using Beautiful Soup. With a bit of tinkering,
it was possible to map every page id to a district (often around 5 offices per district) and collect all data, merge it per district and write to JSON. This resulted in a dataset with the district_ids as keys and an array of objects
as values, each object containing the name of the party, the number of votes and the number of votes lost or gained.
Following the rules described at the lectures, in the project we did our best to choose intuitive visualisations. In the main page we mainly have 5 different visualisations.
Firstly, map is the most intuitive way to display information about a city. Above map you can see a slider and also the type of data (Age, Income etc.) can be set through a dropdow menu. Map is color coded and a legend is provided. The basic
intention here was to provide user a way to analyze any geographical clustering in any feature.
When the visitor clicks an area he/she can see a change on 2 different visualizations below. A bubble
chart displaying the results of the political elections and a stack chart displaying yearly change in the district.
Since there are a lot of political parties, a bubble chart was an intuitive selection. This is because it is possible to see a lot of elements on the same layout at this kind of visualisaton. Here we have paid attention to give same colors
to the same political parties. Also note that we have filtered only parties which have obtained more than 1% of the votes in the district. This is because there are 32 parties in total and it is not ideal to give proportionally bigger space to parties
which did not obtain 1% of the votes.
The second chart updated by the map is Stack Area Chart. This chart shows yearly change of the feature selected. The main intention here was to show user the change of the district by time.
So map is one way to see the city. Another way is by sun burst chart. Everything in the chart is totally interactive. You can filter any data in this chart and see the yearly distribution of the filtered data at the bar chart below. For
example if you click to the inner layer of the chart you would see the distribution of the feature by district (ie only population). However while going outer layers, you can see extra filters and when you click to these areas you would see the
change in the filterd data.
Since our data mainly shows distributions (i.e high income-middle income - lower incom) sun burst chart was just a natural choice. The user easily can see the percentage of high income people at some area. The user also can easily see layers.
For example can compare the number of "singles" in a district and the number of "single who have kids". The main drawback of the sunburst chart is that it contains a lot of different areas thus it is very hard to keep a minimalistic approach.
Finally, even though bar chart is the very basic style bar chart it is always one of the most intuitive ways to put time series information. Note that the color of the bars are same with the chosen area (where data was filtered at sun burst chart)
Contributions
Ahmet Baglan: Sun Burst Chart, Bar Chart, Bubble Chart, Explainer Page.
Wisse Barkhof: Data Collection, General Structure of the Webpage, Data Story, Map Visualisation, Stack Chart, Explainer Page.
Siddharth Chopde:Putting the page online, Bubble Chart
The Data Story
Copenhagen is a highly diverse global city with a lot of different people living in it, that all have different socio economic statuses and voting preferences. We build a tool to visually explore Copenhagen on a district level and look into these data
from many different perspectives and across many different dimensions. Hopefully, this will provide some insights into what moves the people of Copenhagen and can this ultimately be used to guide decision making or political activity.
This story contains multiple parts. First, there is the overview from a geographical viewpoint. A map of the 10 main districts of the Copenghagen municipality shows the differnce in numbers per district for a selected metric, like average age, income
or non Danish migrants. Use the horizontal slider to see how these numbers have changed over the last years. Pro tip: after clicking on the slider, use your arrow keys to scan through it and really see the changes.
The districts are .
Then, a more detailed view is provided for every district, which can be shown by clicking on a district on the map. This shows an overview of the municipal election result from 2013 & 2017 and a year wise breakdown of some distributions of age, income,
migration background and job sector. Here, some real observations can be made on the relationship between --changes in-- demohraphics and the resulting voting behaviour. Since most districts have been growing as Copenhagen, the combined numbers
are usually rising. Interesting to look at would be the changes in income or migration background and rise of votes for populist parties or income and job sectors indicating gentrification and the popularity of progressive or green parties.
Select a metric to explore
Select a year
Indre By
Change in demographics 2008 - 2014
Select a distribution to explore
The map is one way to see the city, another way is by sun burst chart. Take a seat, because this is a very special chart. Everything in the chart is interactive and you can filter any data in this chart. For example, go ahead and choose Brønshøj~Husum
(The red area in the inner circle). You see the population here is more or less stable. Now choose orange area just above the red one. If you made it this far, you should be seeing change in the number of people who are single in Brønshøj~Husum.
You can go on and choose the blue above this one. Now you are seeing the change in the number of people who are single and who do not have children. For example, you can go and see the increase in high income people in Nørrebro, or you can see percentage
of apartments from before 1900 in Østerbro.
This provides a whole new overview and way to look at things, again with the option to look at different metrics for different years. When you click on a specific stat, you'll see a bar chart showing how the total number of that stat has changed over
time. Note: the metrics regarding 'number of apartments' have a second layer metric to specify.