Question: 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
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.
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.
This project requires creating a new environment and installing new packages as well as potentially reinstalling some of the old ones. This may require multiple attempts, perhaps updating Anaconda, andor other packages. Start early!
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 pdmerge onedataframe, anotherdataframe, on 'sOMECOLUMNNAME'; or something similar, for example, with 'lefton and 'righton instead of just onjoin will also work. See some examples here.
Task I suggest do this problem LAST, it's not directly related to the ones above
Create a horizontal bar plot of the Top by "density" neighborhoods in such a way that bars show counts of each Room Type for each neighborhood stacked barplot. Use only one dataset, say listingscsv First, figure out the top neighborhoods by "density". Then, for those neighborhoods only, find the counts of each room type. Then create a stacked bar plot for those neighborhoods, showing the counts for each room type. Something like this:
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
