Where can we live?

Looking for a flat to rent in Barcelona has turned to be a very difficult task for a lot of people: from young professionals to those who want to live alone, even to families with medium income levels. There is an extended feeling that finding some place according to your salary, necessities and preferences is a very time-consuming and tiring challenge.

Using python programming language and coding an algorithm to access one of the main websites to find available properties for rent it is possible to collect data to describe the offer market. After, we can use libraries like plotly, which provide graphing, analytics, and statistics tools to visualize it.

The aim of this exercise is to understand the current status of the offered appartments for rent.

How to get the data?

First of all, we have developed a code to be able to access the data on the web and save it as a .csv file. The image below shows a piece of it.

After doing so, we read the csv with pandas library, which enables us to do different statistical operations. Using other libraries like plotly is very useful to visualize your data with charts like scatters, histogram, bar charts, heatmaps, etc.

What can we discover?

First, we draw a scatter chart to be aware of the outliers.

After, we get rid of them with the following filter: filterPrice = np.abs(df_data[‘price’]-df_data[‘price’].mean())<=(3*df_data[‘price’].std()) and we get a chart like the one below. This chart contains 2 levels of information: the inverse distribution of total_price- and price/m2- curve according to surface (price/m2 values have been scaled tobe visually comparable). From this we can deduct that small flats are relatively more expensive than big ones.

As for the total price, we can see through a histogram that we can find the 50% quantile lies between 1.000 and 1.600 €/month.

Analogue to that, we can use a histogram2D to add one more variable: the surface. Here we can see that most of the offered appartments for rent are below 100m2 and above 1000€/month.

Using a boxplot helps to visualize the mean an standart deviation for prices according to surface categories. As we can see in the diagramm below, up until 300 m2, the smaller the appartments are, the less price variation they offer. In other words: you can find big appartments for wider price range.

Finally, extracting heatmaps allows to work with 3 different variables: price, nr. of rooms and floor. This shows that there is no evidence that the floor influences the price. However, the price/m2 is totally influenced by the surface.

Where can we live? is a project of IAAC, Institute for Advanced Architecture of Catalonia, developed at MaCT (Master in City & Technology), 2017-18 by:

Student: Alba Alsina Maqueda
Faculty: Andre Resende