Skip to content

Here I present the python scripts to download the apartment rentals listed on immoscout24.ch in Switzerland and convert them to pandas data frame in order to easily run machine learning models for price prediction.

Notifications You must be signed in to change notification settings

hamedrazavi/rental_analysis_switzerland_immoscout24

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rental Data Analysis on ImmoScout

This project includes a collection of scripts/classes to get the data from ImmoScout, perform a statistical analysis on the rental data, and display the resulting analysis on an interactive Choropleth map.

ImmoScout Scraper

The class ImmoScout converts the rental data on ImmoScout and can save it as a csv file.

Example:

from ImmoScout import ImmoScout
import pandas as pd

# instantiate the ImmoScout class by setting the city name and listing type
lausanne = ImmoScout(city_name = 'lausanne', list_type = 'rent')

# if some data is already downloaded set 'in_path' to the already saved csv file,
# otherwise just set the output path, i.e., out_path to save the converted data
lausanne.to_csv(in_path = '', out_path='../data/lausanne.csv')

# convert the csv to pandas data frame
df = pd.read_csv('../data/lausanne.csv')

Here is the first 5 rows of df:

index Id SurfaceArea NumRooms Type Address Description Rent Bookmark Link RentPerArea RentPerRoom AreaPerRoom ZipCode
0 0 4695812 41.0 2.0 flat Av. de Cour 65, 1007 Lausanne, VD Appartement de 2 pièces au 5ème étage NaN New /en/d/flat-rent-lausanne/4695812?s=2&t=1&l=202... NaN NaN 20.500000 1007
1 1 5204125 21.0 1.5 studio Route Aloys-Fauquez 122, 1018 Lausanne, VD Studio proche de toutes les commodités 970.0 New /en/d/studio-rent-lausanne/5204125?s=2&t=1&l=2... 46.190476 646.666667 14.000000 1018
2 2 5201717 95.0 4.0 flat Av. de Morges 39, 1004 Lausanne, VD Joli appartement - centre ville proche commodités 2085.0 NaN /en/d/flat-rent-lausanne/5201717?s=2&t=1&l=202... 21.947368 521.250000 23.750000 1004
3 3 5201713 29.0 1.5 flat Ch. du Devin 57, 1012 Lausanne, VD Quartier de Chailly, spacieux 1.5 pièce 910.0 NaN /en/d/flat-rent-lausanne/5201713?s=2&t=1&l=202... 31.379310 606.666667 19.333333 1012
4 4 5195729 11.0 NaN single-room Chemin de Montolivet 19, 1006 Lausanne, VD 1006 Lausanne - Montolivet 19 - Chambre meublé... 560.0 NaN /en/d/single-room-rent-lausanne/5195729?s=2&t=... 50.909091 NaN NaN 1006

Rental data analysis

For the rental data analysis see this notebook. Here is a quick article which include the resulting maps.

About

Here I present the python scripts to download the apartment rentals listed on immoscout24.ch in Switzerland and convert them to pandas data frame in order to easily run machine learning models for price prediction.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published