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 on/together with some maps. The datasets can be downloaded from this link (copy-paste the link if it doesn't go there right away). The size of the file is only around 4.5 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 (73 of them). Others are listings of apartments/rooms 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 6.
Read in 'listings_24.csv', 'listings_30.csv', 'listings_33.csv', and 'listings_45.csv' 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 (e.g. 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 7.
Find the same information as in 6 but this time only use listings for 'Entire home/apt' 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 8.
Merge the results in 7 about the "density" and "price" with the dataframe in task 3. In other words, you should have a dataframe with neighborhood information, plus 8 more columns: density_24, density_30, density_33, density_45, price_24, price_30, price_33, price_45.(Suggestion use pd.merge(one_dataframe, another_dataframe, on= 'sOME_COLUMN_NAME'); or something similar, for example, with 'left_on=' and 'right_on=' instead of just 'on='....join will also work. See some examples here.)
Task 10.
2. Use options of GeoPandas plot to construct a choropleth map in which the neighborhood polygons are shaded in proportion to their price_33 values from your dataframe from Task 8. 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 11.
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!):
Overview Here, we will use Python libraries

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!