Giter Club home page Giter Club logo

airbnb_listings_canada's Introduction

Airbnb_Listings_Canada

Visualized Airbnb Listings Prices across the 13 Canadian provinces and North Territories.

Table of Contents

Overview

In this project, we study Airbnb listings data extracted on August 21st, 2023, from the 13 Canadian provinces and North Territories to visualize their prices.

Aim

The aim of our study is to help travelers make smarter and budget-friendly travel decisions.

Technologies

  • Python 3.7.13
  • Jupyter Notebook
  • HTML/CSS
  • BeautifulSoup
  • Python Dash

Data

Data Scraping

The data was scraped on August 21st, 2023, from airbnb.ca using BeautifulSoup. Two major cities were scraped for each of the 13 Canadian provinces. The only exception here is for Northwest Territories and Nunavut as they only have 1 major available city. The total number of raw dataframes is therefore 24. The initial dataframe for each province is as follows (See Fig.1).

Img1

Fig.1 - Raw dataframe for Ottawa listings.

Data Cleaning

A few cleaning steps were needed:

  • Remove extra-long hyphens and replace them with regular hyphens.
  • The initial data has rating and the number of reviews in the same column. For example: 4.82(140), where 4.82 is the rating, and 140 is the number of reviews. This column was transformed into two separate ones, rating and nb_reviews, and then deleted.
  • The data range suggested by Airbnb was cleaned and separated into two columns: start_date and end_date as the starting and ending dates for availability.
  • For each dataframe, two columns were added: one for the city's name and the second for the province's name.

Analysis and Visualization

Preprocessing Data

All 24 dataframes were merged into one dataframe, containing 6048 listings across Canada, the average, minimum, and maximum listing prices were calculated per province.

Visualizing Data

The listings' prices across Canada were then visualized by creating:

  • A choropleth map and a horizontal bar chart to visualize the average, minimum, and maximum listing prices per Canadian province.
  • A bar chart to visualize the average, the minimum, and the maximum listing prices per bed type for each Canadian province.

Finally, an interactive web application dashboard was developed using Python Dash and Plotly to consolidate all the visualizations.

Airbnb_Final.mp4

Challenges

Multiple challenges were encountered during this project:

  • Updating the scraping code: With each Airbnb update, the scraping code needs to be adjusted to extract the exact data.
  • Building the choropleth map for Canada: By default, the choropleth map is designed for the USA. Creating this map for Canada was challenging. The first step was to locate the GeoJSON data for Canada, and the second step was to create and add an ID column to the final dataframe, with province names matching the GeoJSON and the exact ID numbers.
  • Managing project goals: As I have mentioned on my LinkedIn, a data analyst should recognize that a project is never truly finished. Adjusting to the idea of 'good enough' versus perfection posed a significant challenge.

Summary

At the end of this project, an interactive web application dashboard was created to visualize:

  • The average, maximum, and minimum listing prices across the Canadian provinces.
  • The price of Airbnb listings per bed type for each Canadian province.

airbnb_listings_canada's People

Contributors

mireynm avatar

Stargazers

 avatar Jarrian Gojar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.