Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DESCWe want to query an API endpoint to receive data about currently available apartment listings from a rental website. Among the data fields is a

DESCWe want to query an API endpoint to receive data about currently available apartment listings from a rental website. Among the data fields is a column called num _bedrooms, which takes the value of 1 for a "1-bedroom" apartment and o for a "studio"HISTORYNote: This rental agency only works with studios and 1-bedroom apartments, so there will never be 2+ bedroom listings. Each listing includes information about a "studio" or a "1-bedroom" apartment, so there will never be a listing with both a "studio" and "1-bedroom" offerings in one posting.RULESThe algorithm used occasionally mistags the num_bedrooms value. Specifically, sometimes a "studio" is tagged as having num _bedrooms =1 or a"1-bedroom" is tagged as num_bedrooms =0Further investigation revealed it to be an issue with one of the data fields,description, and the way our algorithm parsed the field to extract a num bedrooms value.For example:"description": "Beautiful 1-bedroom apartment with nearby yoga studio." was detected as a yoga studio instead of 1-bedroom and incorrectly had num_bedrooms =0.Your task is to write a function that takes in the jsonData and corrects this problem. The GET request retrieves the data as a string which looks like this:

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions