DEV Community

Cover image for Understand Airbnb rental landscape in Seattle — Data Analysis
Jingles (Hong Jing)
Jingles (Hong Jing)

Posted on • Originally published at jinglescode.github.io

1 2

Understand Airbnb rental landscape in Seattle — Data Analysis

cover

For all prospective Airbnb hosts in Seattle, I will answer these questions in this article:

  • when to rent to maximise revenue?
  • when is the off-peak season for maintenance?
  • common group size of Seattle travellers, is it 2 or family or 4 or larger?
  • bedroom configurations to maximise booking rates?
  • how to achieve a good rating?
  • do hosts with higher rating have higher revenue?
  • amenities to include?

Get and prepare data

In this article, I will perform exploratory data analysis on the Airbnb dataset gotten from Inside Airbnb.

Fetch Listings data

Our data will be loaded in pandas, comma-separated values (CSV) files can be easily loaded into DataFrame with the read_csv function.
Let us look at what the first 10 rows looks like with pd_listings.head(10):

id name neighbourhood_group_cleansed latitude longitude property_type room_type accommodates bathrooms bedrooms beds amenities price guests_included minimum_nights number_of_reviews review_scores_rating review_scores_accuracy review_scores_cleanliness review_scores_checkin review_scores_communication review_scores_location review_scores_value
241032 Stylish Queen Anne Apartment Queen Anne 47.63628904 -122.3710252 Apartment Entire home/apt 4 1 1 1 {TV,"Cable TV",Internet,"Wireless Internet","Air Conditioning",Kitchen,Heating,"Family/Kid Friendly",Washer,Dryer} $85.00 2 1 207 95 10 10 10 10 9 10
953595 Bright & Airy Queen Anne Apartment Queen Anne 47.63912312 -122.3656665 Apartment Entire home/apt 4 1 1 1 {TV,Internet,"Wireless Internet",Kitchen,"Free Parking on Premises","Buzzer/Wireless Intercom",Heating,"Family/Kid Friendly",Washer,Dryer,"Smoke Detector","Carbon Monoxide Detector","First Aid Kit","Safety Card","Fire Extinguisher",Essentials} $150.00 1 2 43 96 10 10 10 10 10 10
3308979 New Modern House-Amazing water view Queen Anne 47.62972413 -122.3694832 House Entire home/apt 11 4.5 5 7 {TV,"Cable TV",Internet,"Wireless Internet","Air Conditioning",Kitchen,"Free Parking on Premises","Pets Allowed","Pets live on this property",Dog(s),Cat(s),"Hot Tub","Indoor Fireplace",Heating,"Family/Kid Friendly",Washer,Dryer,"Smoke Detector","Carbon Monoxide Detector",Essentials,Shampoo} $975.00 10 4 20 97 10 10 10 10 10 10
7421966 Queen Anne Chateau Queen Anne 47.6384732 -122.3692791 Apartment Entire home/apt 3 1 0 2 {Internet,"Wireless Internet",Kitchen,"Indoor Fireplace",Heating,"Family/Kid Friendly",Washer,Dryer,"Smoke Detector","Carbon Monoxide Detector","Safety Card","Fire Extinguisher",Essentials,Shampoo} $100.00 1 1 0
278830 Charming craftsman 3 bdm house Queen Anne 47.6329184 -122.3724706 House Entire home/apt 6 2 3 3 {TV,"Cable TV",Internet,"Wireless Internet",Kitchen,Heating,"Family/Kid Friendly","Smoke Detector","Carbon Monoxide Detector","First Aid Kit","Fire Extinguisher",Essentials,Shampoo} $450.00 6 1 38 92 9 9 10 10 9 9
5956968 Private unit in a 1920s mansion Queen Anne 47.63052548 -122.3661741 House Private room 2 1 1 1 {"Wireless Internet","Free Parking on Premises",Heating,"Smoke Detector",Essentials,Shampoo} $120.00 1 1 17 95 10 10 10 10 10 10
1909058 Queen Anne Private Bed and Bath Queen Anne 47.63660545 -122.3685191 House Private room 2 1 1 1 {"Wireless Internet","Free Parking on Premises",Heating,"Smoke Detector","First Aid Kit",Essentials,Shampoo} $80.00 1 3 58 99 10 10 10 10 10 10
856550 Tiny Garden cabin on Queen Anne Queen Anne 47.64016054 -122.375856 Cabin Private room 2 1 1 1 {"Wireless Internet","Pets live on this property",Dog(s),Heating,"Family/Kid Friendly",Essentials,Shampoo} $60.00 1 2 173 97 10 10 10 10 9 10
4948745 Urban Charm || Downtown || Views Queen Anne 47.6324103 -122.3572161 Apartment Private room 2 1 1 1 {TV,"Cable TV",Internet,"Wireless Internet",Kitchen,Breakfast,"Indoor Fireplace",Heating,Washer,Dryer,"Smoke Detector","First Aid Kit","Fire Extinguisher",Essentials,Shampoo} $90.00 1 3 8 97 10 9 10 9 10 10

And examine the summary of the numerical data with pd_listings.describe():

id latitude longitude accommodates bathrooms bedrooms beds guests_included minimum_nights number_of_reviews review_scores_rating review_scores_accuracy review_scores_cleanliness review_scores_checkin review_scores_communication review_scores_location review_scores_value
count 3.818000e+03 3818.000000 3818.000000 3818.000000 3802.000000 3812.000000 3817.000000 3818.000000 3818.000000 3818.000000 3171.000000 3160.000000 3165.000000 3160.000000 3167.000000 3163.000000 3162.000000
mean 5.550111e+06 47.628961 -122.333103 3.349398 1.259469 1.307712 1.735394 1.672603 2.369303 22.223415 94.539262 9.636392 9.556398 9.786709 9.809599 9.608916 9.452245
std 2.962660e+06 0.043052 0.031745 1.977599 0.590369 0.883395 1.139480 1.311040 16.305902 37.730892 6.606083 0.698031 0.797274 0.595499 0.568211 0.629053 0.750259
min 3.335000e+03 47.505088 -122.417219 1.000000 0.000000 0.000000 1.000000 0.000000 1.000000 0.000000 20.000000 2.000000 3.000000 2.000000 2.000000 4.000000 2.000000
25% 3.258256e+06 47.609418 -122.354320 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 93.000000 9.000000 9.000000 10.000000 10.000000 9.000000 9.000000
50% 6.118244e+06 47.623601 -122.328874 3.000000 1.000000 1.000000 1.000000 1.000000 2.000000 9.000000 96.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000
75% 8.035127e+06 47.662694 -122.310800 4.000000 1.000000 2.000000 2.000000 2.000000 2.000000 26.000000 99.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000
max 1.034016e+07 47.733358 -122.240607 16.000000 8.000000 7.000000 15.000000 15.000000 1000.000000 474.000000 100.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000

Observations:

  • there are 3813 listings in this dataset
  • values in the price column contain the dollar symbol ($)
  • there are missing values in columns bathrooms, bedrooms, and beds there are missing values in reviews rating columns (review_scores_rating, review_scores_accuracy, review_scores_cleanliness, review_scores_checkin, review_scores_communication, review_scores_location, - review_scores_value)

Data preparation

The column price, which is the price of the listing, it contains the dollar sign ($). We still can’t use it for analysis as it is not a numerical value, so we remove the dollar symbol and convert the values as numeric values:

pd_listings['price'] = pd_listings['price'].str.replace("[$, ]", "").astype("float")

Then replace those empty values with zero:

pd_listings.at[pd_listings['bathrooms'].isnull(), 'bathrooms'] = 0
pd_listings.at[pd_listings['bedrooms'].isnull(), 'bedrooms'] = 0
pd_listings.at[pd_listings['beds'].isnull(), 'beds'] = 0
pd_listings.at[pd_listings['review_scores_rating'].isnull(), 'review_scores_rating'] = 0
pd_listings.at[pd_listings['review_scores_accuracy'].isnull(), 'review_scores_accuracy'] = 0
pd_listings.at[pd_listings['review_scores_cleanliness'].isnull(), 'review_scores_cleanliness'] = 0
pd_listings.at[pd_listings['review_scores_checkin'].isnull(), 'review_scores_checkin'] = 0
pd_listings.at[pd_listings['review_scores_communication'].isnull(), 'review_scores_communication'] = 0
pd_listings.at[pd_listings['review_scores_location'].isnull(), 'review_scores_location'] = 0
pd_listings.at[pd_listings['review_scores_value'].isnull(), 'review_scores_value'] = 0

Lastly, to rename id to listing_id:

pd_listings.rename(columns={'id':'listing_id'}, inplace=True)

Fetch Reviews data

Let us load another CSV file which contains the reviews for each listing. The DataFrame contains the following columns:

  • id — identification number for review
  • listing_id — identification number for listing which we can join with the above DataFrame
  • date — date of the review

Calculate estimated revenue for each listing

I suppose that each review is a successful booking and guests stayed some number of nights. Unfortunately, we do not know the exact number of nights each guest stayed, but we could use the listing’s minimum_nights, to assume each guest stayed at least that minimum number of nights. For each review, price * minimum_nights to get each booking’s revenue:

pd_bookings = pd.merge(pd_reviews, pd_listings, on='listing_id')
pd_bookings['estimated_revenue'] = pd_bookings['price'] * pd_bookings['minimum_nights']

Sum up the revenue of every booking for each listing as estimated revenue per listing:

pd_listings_revenue = pd_bookings[['listing_id','estimated_revenue']].groupby(['listing_id']).sum()

And merged the estimated revenue into the existing DataFrame (listing):

pd_listings = pd.merge(pd_listings, pd_listings_revenue, on='listing_id', how='left')
pd_listings.at[pd_listings['estimated_revenue'].isnull(), 'estimated_revenue'] = 0

And we have our DataFrame ready for some analysis. Each row represents one listing, its attributes, and its estimated revenue:

listing_id name neighbourhood_group_cleansed latitude longitude property_type room_type accommodates bathrooms bedrooms beds amenities price guests_included minimum_nights number_of_reviews review_scores_rating review_scores_accuracy review_scores_cleanliness review_scores_checkin review_scores_communication review_scores_location review_scores_value estimated_revenue
0 241032 Stylish Queen Anne Apartment Queen Anne 47.63628904 -122.3710252 Apartment Entire home/apt 4 1 1 1 {TV,"Cable TV",Internet,"Wireless Internet","Air Conditioning",Kitchen,Heating,"Family/Kid Friendly",Washer,Dryer} 85 2 1 207 95 10 10 10 10 9 10 17595
1 953595 Bright & Airy Queen Anne Apartment Queen Anne 47.63912312 -122.3656665 Apartment Entire home/apt 4 1 1 1 {TV,Internet,"Wireless Internet",Kitchen,"Free Parking on Premises","Buzzer/Wireless Intercom",Heating,"Family/Kid Friendly",Washer,Dryer,"Smoke Detector","Carbon Monoxide Detector","First Aid Kit","Safety Card","Fire Extinguisher",Essentials} 150 1 2 43 96 10 10 10 10 10 10 12900
2 3308979 New Modern House-Amazing water view Queen Anne 47.62972413 -122.3694832 House Entire home/apt 11 4.5 5 7 {TV,"Cable TV",Internet,"Wireless Internet","Air Conditioning",Kitchen,"Free Parking on Premises","Pets Allowed","Pets live on this property",Dog(s),Cat(s),"Hot Tub","Indoor Fireplace",Heating,"Family/Kid Friendly",Washer,Dryer,"Smoke Detector","Carbon Monoxide Detector",Essentials,Shampoo} 975 10 4 20 97 10 10 10 10 10 10 78000
3 7421966 Queen Anne Chateau Queen Anne 47.6384732 -122.3692791 Apartment Entire home/apt 3 1 0 2 {Internet,"Wireless Internet",Kitchen,"Indoor Fireplace",Heating,"Family/Kid Friendly",Washer,Dryer,"Smoke Detector","Carbon Monoxide Detector","Safety Card","Fire Extinguisher",Essentials,Shampoo} 100 1 1 0 0 0 0 0 0 0 0 0
4 278830 Charming craftsman 3 bdm house Queen Anne 47.6329184 -122.3724706 House Entire home/apt 6 2 3 3 {TV,"Cable TV",Internet,"Wireless Internet",Kitchen,Heating,"Family/Kid Friendly","Smoke Detector","Carbon Monoxide Detector","First Aid Kit","Fire Extinguisher",Essentials,Shampoo} 450 6 1 38 92 9 9 10 10 9 9 17100
5 5956968 Private unit in a 1920s mansion Queen Anne 47.63052548 -122.3661741 House Private room 2 1 1 1 {"Wireless Internet","Free Parking on Premises",Heating,"Smoke Detector",Essentials,Shampoo} 120 1 1 17 95 10 10 10 10 10 10 2040
6 1909058 Queen Anne Private Bed and Bath Queen Anne 47.63660545 -122.3685191 House Private room 2 1 1 1 {"Wireless Internet","Free Parking on Premises",Heating,"Smoke Detector","First Aid Kit",Essentials,Shampoo} 80 1 3 58 99 10 10 10 10 10 10 13920
7 856550 Tiny Garden cabin on Queen Anne Queen Anne 47.64016054 -122.375856 Cabin Private room 2 1 1 1 {"Wireless Internet","Pets live on this property",Dog(s),Heating,"Family/Kid Friendly",Essentials,Shampoo} 60 1 2 173 97 10 10 10 10 9 10 20760
8 4948745 Urban Charm || Downtown || Views Queen Anne 47.6324103 -122.3572161 Apartment Private room 2 1 1 1 {TV,"Cable TV",Internet,"Wireless Internet",Kitchen,Breakfast,"Indoor Fireplace",Heating,Washer,Dryer,"Smoke Detector","First Aid Kit","Fire Extinguisher",Essentials,Shampoo} 90 1 3 8 97 10 9 10 9 10 10 2160
9 2493658 Airy + Bright Queen Anne Apartment Queen Anne 47.63749172 -122.3668886 Apartment Entire home/apt 4 1 1 1 {TV,Internet,"Wireless Internet",Kitchen,"Free Parking on Premises","Buzzer/Wireless Intercom",Heating,"Family/Kid Friendly",Washer,Dryer,"Smoke Detector","Carbon Monoxide Detector","First Aid Kit","Safety Card","Fire Extinguisher",Essentials} 150 1 2 32 97 10 10 10 10 10 9 9600

Begin analysis

Revenue by neighbourhoods

This table shows the average revenue of listings in each neighbourhood:

neighbourhood_group_cleansed estimated_revenue
Downtown 7247.666037735849
Capitol Hill 7064.079365079365
Beacon Hill 6606.983050847458
Ballard 6078.726086956522
Queen Anne 6038.752542372881
Central Area 4636.371273712737
Other neighborhoods 4409.843828715365
Cascade 4075.1348314606744
Seward Park 4063.5
Rainier Valley 3827.3459119496856
Delridge 3641.1898734177216
Magnolia 3587.8196721311474
West Seattle 3370.783251231527
Northgate 2962.3625
Lake City 2476.4328358208954
Interbay 2105.7272727272725
University District 1558.5573770491803

airbnb

Airbnb properties in Downtown, Capitol Hill and Beacon Hill can fetch the highest revenue. It’s shopping and CBD district.

airbnb

Downtown, Capitol Hill and Beacon Hill can fetch the highest revenue

Popular period of the year to rent?

It would be useful to know the most popular time of the year to rent in Seattle, so Airbnb hosts are able to decide when to rent and when is the time for maintenance.

airbnb

July, August and September are the best periods to maximise revenue. Months before May are the best time for maintenance work. From October to December is a good time to take a break and enjoy the holidays if they want to.

July, August and September are the best periods to maximise revenue.

Highest revenue listings

These are the top 5 listings with the highest estimated revenue:

listing_id number_of_reviews minimum_nights accommodates bedrooms beds estimated_revenued
2617 3594885 8 1000 4 1.0 1.0 1200000.0
2107 5056580 100 31 2 1.0 1.0 306900.0
1500 4009508 38 20 5 2.0 2.0 266000.0
1537 1954452 71 14 2 1.0 1.0 218680.0
1519 3971934 48 20 3 1.0 1.0 171840.0

Wow! Looks like our top earners are hosts have minimum nights of 1000. But it might be data anomaly because 1000 nights are kind of extreme, so let’s look at the proportion of listings with different minimum_nights.

minimum_nights '# of listings'
1 1610
2 1423
3 480
4 122
5 67
6 16
7 50
8 1
10 5
11 1
12 1
13 2
14 16
15 1
20 11
21 1
26 1
28 1
29 1
30 6
31 1
1000 1

Most hosts have minimum nights of up to a month, the host with 1000 nights, gotta filter it away.

These are the top hosts (up to 7 minimum nights) with the highest estimated revenue.

listing_id number_of_reviews minimum_nights accommodates bedrooms beds estimated_revenued
1070 3385421 31 6 4 2.0 2.0 103602.0
2 3308979 20 4 11 5.0 7.0 78000.0
3667 53803 41 7 4 3.0 3.0 71750.0
1592 9460 240 3 2 1.0 1.0 71280.0
3165 3040278 156 2 4 2.0 2.0 67704.0

These are the top hosts (up to 4 minimum nights) with the highest estimated revenue.

listing_id number_of_reviews minimum_nights accommodates bedrooms beds estimated_revenued
2 3308979 20 4 11 5.0 7.0 78000.0
1592 9460 240 3 2 1.0 1.0 71280.0
3165 3040278 156 2 4 2.0 2.0 67704.0
3216 481220 164 2 4 1.0 3.0 63960.0
2922 699596 136 3 2 1.0 1.0 61200.0

From these 2 tables, longer minimum nights results in higher revenue. Let's look at the correlation between minimum nights and estimated revenue.

minimum_nights estimated_revenue
minimum_nights 1.0 0.8720842868140248
estimated_revenue 0.8720842868140248 1.0

And the correlation between minimum nights and estimated revenue after removing the listing with 1000 minimum nights.

minimum_nights estimated_revenue
minimum_nights 1.000000 0.199189
estimated_revenue 0.199189 1.000000

Host with 1000 minimum nights has caused a bais towards higher minimum nights resulted in higher revenue, with a correlation of 87% between minimum nights and revenue. But after removing that host, minimum nights and estimated revenue are not highly correlated, a correlation of 20% between minimum nights and revenue.

Minimum nights and estimated revenue are not highly correlated

airbnb

Supply and demand — bedroom configurations

As an Airbnb host, it will be good to know if my property is oversaturated in the market. Find out the ratio between the number of listings (supply) to the number of bookings (demand) of different bedroom configurations:

# of bedrooms # of listings # of bookings ratio
1.0 2417 61399 25.402978899462145
0.0 378 8403 22.23015873015873
2.0 640 10593 16.5515625
6.0 6 82 13.666666666666666
3.0 283 3593 12.696113074204947
5.0 24 205 8.541666666666666
4.0 69 569 8.246376811594203
7.0 1 5 5.0

Listings with less than 2 bedrooms are well sought after.

But wait! Properties with no bedrooms, what are kind of properties are these?

room_type # of listings
Entire home/apt 378

And the number of beds in these properties?

# of beds # of listings
1.0 292
2.0 76
3.0 8
4.0 2

All of these properties which no bedrooms are renting the entire apartment, and they do provide at least one bed. Phew~

Supply and demand — guest group configuration

As an Airbnb host, I would also like to know the common group size of Seattle visitors. So as to find out if my property configuration is oversaturated in the market.

accommodates # of listings # of bookings ratio
14 3 83 27.666666666666668
2 1627 42821 26.31899200983405
3 398 10170 25.55276381909548
10 25 520 20.8
4 785 16041 20.4343949044586
7 52 956 18.384615384615383
5 184 3221 17.505434782608695
6 332 5580 16.80722891566265
12 15 229 15.266666666666667
1 256 3542 13.8359375
8 119 1501 12.61344537815126
16 4 48 12.0
15 2 19 9.5
9 13 98 7.538461538461538
11 3 20 6.666666666666667

A place which accommodates 14 ranked first (highest supply/demand ratio), but the number of bookings is low (only 83 bookings) as compared to places for 2 or 3 people.

Renting a place for 2 or 3 people will give the host pretty good regular rentals.

airbnb

Supply and demand — bedroom configurations for 2 to 3

So let us focus on renting properties for 2 to 3 people since more than half travel in a group of this size. Do these guests prefer 1 bedroom or 2 separate bedrooms?

Airbnb bedroom configurations for 2 people:

bedrooms # of listings # of bookings ratio
1.0 1613 40897 25.354618722876626
0.0 261 5376 20.597701149425287
2.0 9 90 10.0

Airbnb bedroom configurations for 3people:

bedrooms # of listings # of bookings ratio
1.0 311 8214 26.411575562700964
0.0 53 1396 26.339622641509433
2.0 34 560 16.470588235294116

The majority prefers 1 bedroom.

The majority prefers 1 bedroom, less than 1% prefers 2 bedrooms. So for groups of 2s or 3s, they prefer 1 bedroom. But this could be due to the current supply of 2 bedroom properties are low.

airbnb

What factors matters?

Having good ratings is important for Airbnb hosts. Let us compare how different factors affect overall ratings:

airbnb

Good communication affects the overall rating and check-in rating

Communication has the highest correlation with the overall rating. Host in Seattle (maybe elsewhere too) needs to be responsive and friendly because good communication tends to get a high overall rating. Good communication also directly impacts the check-in rating.

Does having a good overall rating means the listing will bring in good wealth?

airbnb

Having a good overall rating has a very small positive correlation with estimated revenue. And having a good rating has almost no impact on the price set by the host.

But still, having a good overall rating is highly recommended.

Amenities

These are the number of Airbnbs in Seattle that provides these amenities:

amenities # of listings provide
Wireless Internet 3667.0
Heating 3627.0
Kitchen 3423.0
Smoke Detector 3281.0
Essentials 3237.0
Dryer 2997.0
Washer 2992.0
Internet 2811.0

Internet, heating and kitchen are necessities in Seattle.

Smoke detector? I just learnt that the Washington State Building Code has required smoke detectors in all dwellings since 1973.

Summary

So, here is the summary of this article:

airbnb

Notebook

Check out the codes used in this article!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay