Overview
Spanish real estate market can be intense:
- Wages are one of the lowest in the E.U. (most common annually salary, statistical mode, is 16,490€. Around 1,100€ per month after taxes)
- High rate of unemployment.
- Job vacancies concentrate in the big cities.
- Incredible rise of the house rent prices in cities like Madrid and Barcelona.
Given the situation, room sharing is becoming the only choice for many employees that want to live close to their place of work.
Let’s try to explore a little deeper what is happening in the Spanish room rental market with the next interactive map.
You can explore the map in a separate page to see a cleaner source code
Read further to understand the data and visualization behind it.
Data
There is a mayor digital player in the Spanish room sharing advertising market, idealista.com, and lots of secondary players like Badi, Milanuncios, Spotahome…
I’ve extracted the data from idealista because I’ve already made a scrapper for this web-page: Dedomeno: A Spanish real estate (Idealista) python scraper.
I took a snapshot of Idealista room renting market for Spain on a random day in February. I used, like I did in Madrid Neighborhood monthly parking post, Scrapy (for scraping) and Django (for simple queries) python frameworks.
I used pandas library to clean the data in a DataFrame format, grouping by province and municipality code to calculate the median. I also added the official geocode m_code
for each municipality so it could be compatible with the Spanish National Statistical Institute (INE) municipality code: m_code = int(province) + munic
You can download the csv from: spain_muni_median_rent_room.csv
As you can see in the interactive map at the beginning of this post, there is a huge number of municipalities with no data.
For example Guadalajara province only has a few municipalities close to Madrid province where people offer a room to rent. This is because in rural areas the price of a full apartment is lower than renting a room in big cities.
Exploring the map further we can see a rare phenomenon; the highest room rental prices are on two small islands in the Mediterranean sea, part of the Balearic Islands: Ibiza and Formentera. This could be explained because there is a high demand for holiday apartments (specially with airbnb) and there are not enough houses available for the local people to afford them.
If you know how to read Spanish, take a look at this newspaper article called “No place to live in Ibiza”: En Ibiza no hay quien viva
In Ibiza we can check what is the sample size for each municipality, and for example in Sant Josep de sa Talia or Santa Euleria des Rius there are around 10 rooms for rent:
Visualization
Martín Gonzalez maintains a repository that provides a simple script to generate TopoJSON files from the Spanish National Geographic Institute’s National Reference Geographic Equipment vector data called es-atlas, that is inspired in Mike Bostock’s us-atlas and world-atlas. He also maintains with Lukas Appelhans Span, a small library to create modern Canvas maps with D3.
Lazy as I am, I just copied one of his examples, changed the legends, more detailed administrative borders, colors and made a small snippet directly in django console to change the rate
variable:
You can download the json used in this example from:
Conclusions
As happened in last post, Madrid Neighborhood monthly parking, we have a poor quality sample size:
This is because there aren’t any final prices (16,5K rooms is a decent sample). We don’t have a way to be sure what the final price of that room was.
As we concluded in the previous post, we could avoid this issue if a snapshot were taken every day for at least one month and get rid of those items that have been on-line for a long period of time. This would avoid the highest items prices that are not going to be rented and also we could make our sample size bigger.
On the other hand, this map is far more understandable; it’s interactive, zoomable and it shows information of the name and median rent price.