Answered step by step
Verified Expert Solution
Question
1 Approved Answer
100 Question 3.5. Create new table called with_previous_compensation. It should be a copy of compensation, but with the (No previous year) CEOs filtered out, and
100 Question 3.5. Create new table called with_previous_compensation. It should be a copy of compensation, but with the "(No previous year)" CEOs filtered out, and with an extra column called 2014 Total Pay ($). That column should have each CEO's pay in 2014. Hint 1: You can print out your results after each step to make sure you're on the right track. Hint 2: We've provided a structure that you can use to get to the answer. However, if it's confusing, feel free to delete the current structure and approach the problem your own way! [ ]: # Definition to turn percent to number def percent_string_to_num(percent_string): "Converts a percentage string to a number." return float(percent_string.strip("")) # Compensation table where there is a previous year having_previous_year = comensation.where("% Change", are.not_equal_to("(No previos year)")) # Get the percent changes as numbers instead of strings # We're still working off the table having_previous_year percent_changes = having_previous_year.apply(percent_string_to_num,'% Change") # Calculate the previous year's pay # We're still working off the table having_previous_year previous_pay = # Put the previous pay column into the having_previous_year table with_previous_compensation = ... with_previous_compensation [ ]: grader.check("435")
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