Question: Overview Here, we will use Python libraries GeoPandas and contextily to read and analyze datasets related to Airbnb listings in Barcelona. We will concentrate on
Overview
Here, we will use Python libraries GeoPandas and contextily to read and analyze datasets related to Airbnb listings in Barcelona. We will concentrate on visualizing data ontogether with some maps. The datasets can be downloaded from this link copypaste the link if it doesn't go there right away The size of the file is only around Mb Unzip them into your working folder. In other words, your data should be sitting in the Data subfolder of your working folder.
There are two types of datasets. One is a geojson file that contains the "geometry" of Barcelona neighborhoods of them Others are listings of apartmentsrooms available for rent on Airbnb at various times. These were downloaded from Airbnb archives and contain information about locations including which neighborhood prices, room types, and more. I
As always with Python libraries, you will have to work with documentation, especially for visualization tasks. I went over some details in a class lecture, but you still might need to discover certain things by yourself.
Task
Read in 'listingscsv 'listingscsv 'listingscsv and 'listingscsv as well. The four csv files are Barcelona listings made at different times. For each of those find
The total number of listings for each neighborhood.
The "density" of listings total number divided by the area for each neighborhood.
The median price of listings for each neighborhood.
Note: You may need to "clean" the data so you don't end up with NaNs in your values eg price If you find situations that produce NaN, deal with it the way you see fit and give a short explanation in a markup cell.
Task
Find the same information as in but this time only use listings for 'Entire homeapt room type.
The total number of listings for each neighborhood.
The "density" of listings total number divided by the area for each neighborhood.
The median price of listings for each neighborhood.
Task
Merge the results in about the "density" and "price" with the dataframe in task In other words, you should have a dataframe with neighborhood information, plus more columns: density density density density price price price priceSuggestion use pdmergeonedataframe, anotherdataframe, on 'sOMECOLUMNNAME'; or something similar, for example, with 'lefton and 'righton instead of just onjoin will also work. See some examples here.
Task
Use options of GeoPandas plot to construct a choropleth map in which the neighborhood polygons are shaded in proportion to their price values from your dataframe from Task You can pick any colormap you want from the available options. Your plot should look something like that but not necessarily exactly like that!:
Task
Use subplots to show choropleth maps forall four price columns all plots in one row Place titles on each plot. Pick your own colormap. Your plot should look something like that but not necessarily exactly like that!:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
