Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Load theairbnb_data. csvas a list of dictionaries into a new variable calledairbnb_data. Once you load the data, you should see something like this when you

Load theairbnb_data. csvasa list of dictionariesinto a new variable calledairbnb_data. Once you load the data, you should see something like this when you printairbnb_data:

 [ { 'listing_id': '1133718', 'survey_id': '1280', 'host_id': '6219420', 'room_type': 'Shared room', 'country': '', 'city': 'Singapore', 'borough': '', 'neighborhood': 'MK03', 'reviews': '9', 'overall_satisfaction': '4.5', 'accommodates': '12', 'bedrooms': '1.0', 'bathrooms': '', 'price': '74.0', 'minstay': '', 'last_modified': '2017-05-17 09:10:25.431659', 'latitude': '1.293354', 'longitude': '103.769226', 'location': '0101000020E6100000E84EB0FF3AF159409C69C2F693B1F43F' } ... ] 

Q4. Plot a distribution of counts of the overall_satisfaction[10 marks]

Note: You should filter out listings whose reviews are 0.

Hint

Counting with dictionaries

  1. Iterate over the dictionary (using.items())
  2. Using what you get in each iteration, populate 2 lists:
  • 1 list for all the scores labels
  • 1 list for all the counts
  1. Plot with the 2 lists

Expected Output:

In[]:

# Remember to import the relevant library/ libraries!  # Write your code below: 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Discuss the reason (motives) why firms go international.

Answered: 1 week ago