Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!