Answered step by step
Verified Expert Solution
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 for a bedroom" apartment and o for a "studio"HISTORYNote: This rental agency only works with studios and bedroom apartments, so there will never be bedroom listings. Each listing includes information about a "studio" or a bedroom" apartment, so there will never be a listing with both a "studio" and bedroom" offerings in one posting.RULESThe algorithm used occasionally mistags the numbedrooms value. Specifically, sometimes a "studio" is tagged as having num bedrooms or abedroom" is tagged as numbedrooms Further 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 bedroom apartment with nearby yoga studio." was detected as a yoga studio instead of bedroom and incorrectly had numbedrooms 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
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