71|PYTHON – Derek’s Debacle

BYU Student Author : @Brett_Lowe, @Sterling_Lane
Reviewers: @MitchFrei, @Spencer, @Mike_Paulsin, @Trent_Barlow
Estimated Time to Solve: 15 Minutes

We provide the solution to this challenge using:

Need a program? Click here.

Overview
Your 16-year-old son, Derek, just burst into your office and let you know that his driver’s license came in the mail today. He’s been saving up for a car since age 9, and now that he can legally drive, he’s ready to make the big purchase. Knowing that you are financially savvy and will take his wellbeing into consideration, Derek begs you to help him find the right car.

He tells you that he can afford a $21,000 car, but he hasn’t taken any extra fees into consideration. You’ll need to be mindful of taxes, registration costs, insurance premiums, etc. when forming your opinion. You also know from experience that Derek is a terrible driver, so you plan to prioritize safety ratings. Lastly, Derek is notorious for changing his mind, so it’s possible that he may want a different car a year from now. You’ll want to confirm that the resale value after one year is at least $12,000.

Instructions

  1. Download each of the relevant files.
  2. Join each of the files together into a single data frame for analysis
  3. Create a new column called “Total_cost” that represents the sum of the cost of the car and any additional fees. Filter out any cars with a total cost greater than $21,000.
  4. Filter out any cars with a safety rating less than or equal to 4.5.
  5. Filter out any cars with a resale value less than $12,000.
  6. Using the Display function, show Derek the car of his dreams.

Data Files

  1. File 83a contains the ID, make, and model of each car.
  2. File 83b contains the ID, pricing, and resale value after one year for each car.
  3. File 83c contains the ID and safety rating for each car.
Suggestions and Hints

a. Make sure you have the CSV files saved in the same folder as your Python/Jupyter file

Solution