An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden.

Overview

sweden-rent-dashboard

An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden.

The dashboard/web-app generated from this project can be viewed by clicking here The dashboard was built to be highly interactive so please do feel free to interact with the figures, dialog buttons, sliders and text inputs. (Unfortunately, the web-app does not render well on mobile devices.)

Preview of the Dashboard Overview Page

SwedenDashBoard

Code and Resources Used

  • Python Version: 3.8
  • Packages Used: pandas, numpy, json, dash, plotly, BeautifulSoup, requests, urllib.request (Those that are required for hosting the web-app can be installed using: pip install -r requirements.txt after cloning the repo).
  • Statistical Data: Downloaded from Statistics Sweden. The median values were used instead of the means as the underlying distribution of each data set is unavailable.
  • Web scraping: Performed on various sites including wiki, Information Sverige and Open Street Map.
  • GeoJSON (Map) Data: Obtained from Open Street Map using their API. See section below for further details.

Repository Layout

Main folder

  • app.py: Used to generate the Plotly/Dash web-app. In order to run this you will need to have run all the below scripts in advance or use the files provided in the "assets" folder in this repo.

  • "get_kommun_county_info.py": This script web scrapes from both wiki and Information Sverige to:

    • Generate a dictionary that states what county ("län" in Swedish) each municipality ("kommun" in Swedish) belongs to.
    • Obtain a short bit of introductory text about each municipality.
    • Store the web address for each municipality's page on Information Sverige.
  • "prepare_rent_data.py": Takes the 4 Statistics Sweden excel files (these can be found in the "stats" folder) and cleans/reformats them. Outputs are saved as ".csv" files in the "assets" folder and are loaded into the web-app.

  • "get_geojson_data.py": This script first web scrapes relation numbers (like an i.d. number for a map file) for all counties ("län" in Swedish) and municipalities ("kommuner" in Swedish) in Sweden from Open Street Map. The relation numbers are then used to download GeoJSON files from the OSM database and merged to create maps of Sweden (with borders marked at both the county and municipality levels). The original map files generated from this process ("counties_map.json" and "kommuner_map.json") and they were then "simplified" (resolution decreased) using mapshaper to improve page loading times on the web-app.

Folder: stats

The four ".xlsx" files were obtained directly from Statistics Sweden and left unaltered. The file "sources.txt" provides additional information about how exactly these files were obtained.

Folder: assets

These are the resources read in and used by the Plotly/Dash web-app. These were all generated in advance using the scripts described in the main folder.

Issues/Comments/Questions

Please feel free to open an issue or pull request if you have any issues/comments/questions or notice something that could be improved.

Owner
Rory Crean
Postdoctoral Researcher in Computational Chemistry
Rory Crean
Schema validation for Xarray objects

xarray-schema Schema validation for Xarray installation This package is in the early stages of development. Install it from source: pip install git+gi

carbonplan 22 Oct 31, 2022
Plotly Dash Command Line Tools - Easily create and deploy Plotly Dash projects from templates

🛠️ dash-tools - Create and Deploy Plotly Dash Apps from Command Line | | | | | Create a templated multi-page Plotly Dash app with CLI in less than 7

Andrew Hossack 50 Dec 30, 2022
Interactive chemical viewer for 2D structures of small molecules

👀 mols2grid mols2grid is an interactive chemical viewer for 2D structures of small molecules, based on RDKit. ➡️ Try the demo notebook on Google Cola

Cédric Bouysset 154 Dec 26, 2022
Create charts with Python in a very similar way to creating charts using Chart.js

Create charts with Python in a very similar way to creating charts using Chart.js. The charts created are fully configurable, interactive and modular and are displayed directly in the output of the t

Nicolas H 68 Dec 08, 2022
LinkedIn connections analyzer

LinkedIn Connections Analyzer 🔗 https://linkedin-analzyer.herokuapp.com Hey hey 👋 , welcome to my LinkedIn connections analyzer. I recently found ou

Okkar Min 5 Sep 13, 2022
JSNAPY example: Validate NAT policies

JSNAPY example: Validate NAT policies Overview This example will show how to use JSNAPy to make sure the expected NAT policy matches are taking place.

Calvin Remsburg 1 Jan 07, 2022
Python package to Create, Read, Write, Edit, and Visualize GSFLOW models

pygsflow pyGSFLOW is a python package to Create, Read, Write, Edit, and Visualize GSFLOW models API Documentation pyGSFLOW API documentation can be fo

pyGSFLOW 21 Dec 14, 2022
Easily convert matplotlib plots from Python into interactive Leaflet web maps.

mplleaflet mplleaflet is a Python library that converts a matplotlib plot into a webpage containing a pannable, zoomable Leaflet map. It can also embe

Jacob Wasserman 502 Dec 28, 2022
Visualize large time-series data in plotly

plotly_resampler enables visualizing large sequential data by adding resampling functionality to Plotly figures. In this Plotly-Resampler demo over 11

PreDiCT.IDLab 604 Dec 28, 2022
The plottify package is makes matplotlib plots more legible

plottify The plottify package is makes matplotlib plots more legible. It's a thin wrapper around matplotlib that automatically adjusts font sizes, sca

Andy Jones 97 Nov 04, 2022
Python implementation of the Density Line Chart by Moritz & Fisher.

PyDLC - Density Line Charts with Python Python implementation of the Density Line Chart (Moritz & Fisher, 2018) to visualize large collections of time

Charles L. Bérubé 10 Jan 06, 2023
A simple python tool for explore your object detection dataset

A simple tool for explore your object detection dataset. The goal of this library is to provide simple and intuitive visualizations from your dataset and automatically find the best parameters for ge

GRADIANT - Centro Tecnolóxico de Telecomunicacións de Galicia 142 Dec 25, 2022
A customized interface for single cell track visualisation based on pcnaDeep and napari.

pcnaDeep-napari A customized interface for single cell track visualisation based on pcnaDeep and napari. 👀 Under construction You can get test image

ChanLab 2 Nov 07, 2021
Gesture controlled media player

Media Player Gesture Control Gesture controller for media player with MediaPipe, VLC and OpenCV. Contents About Setup About A tool for using gestures

Atharva Joshi 2 Dec 22, 2021
Fast 1D and 2D histogram functions in Python

About Sometimes you just want to compute simple 1D or 2D histograms with regular bins. Fast. No nonsense. Numpy's histogram functions are versatile, a

Thomas Robitaille 237 Dec 18, 2022
Application for viewing pokemon regional variants.

Pokemon Regional Variants Application Application for viewing pokemon regional variants. Run The Source Code Download Python https://www.python.org/do

Michael J Bailey 4 Oct 08, 2021
Automatically visualize your pandas dataframe via a single print! 📊 💡

A Python API for Intelligent Visual Discovery Lux is a Python library that facilitate fast and easy data exploration by automating the visualization a

Lux 4.3k Dec 28, 2022
Dimensionality reduction in very large datasets using Siamese Networks

ivis Implementation of the ivis algorithm as described in the paper Structure-preserving visualisation of high dimensional single-cell datasets. Ivis

beringresearch 284 Jan 01, 2023
Python toolkit for defining+simulating+visualizing+analyzing attractors, dynamical systems, iterated function systems, roulette curves, and more

Attractors A small module that provides functions and classes for very efficient simulation and rendering of iterated function systems; dynamical syst

1 Aug 04, 2021
Rubrix is a free and open-source tool for exploring and iterating on data for artificial intelligence projects.

Open-source tool for exploring, labeling, and monitoring data for AI projects

Recognai 1.5k Jan 07, 2023