Answered step by step
Verified Expert Solution
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
- Iterate over the dictionary (using.items())
- Using what you get in each iteration, populate 2 lists:
- 1 list for all the scores labels
- 1 list for all the counts
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started