Question: Please solve the following python question Example questions: Given two dataFrames as follows and answer questions. df1 City Boston 645,966 New York 8,336,697 POP df2
Please solve the following python question

Example questions: Given two dataFrames as follows and answer questions. df1 City Boston 645,966 New York 8,336,697 POP df2 Newspaper City Readers Boston Globe Boston, MA 245,572 New York Times New York, NY 1,865,318 1. List the steps to combine these two dataFrames and create a new one which contains the columns: City, POP, Newspaper, Readers. (Hint: need to modify the column "City" in df2 so that it can join with df1) 2. Write the steps to find the city with highest ratio of readers to population. (Hint: First, set the column 'City' as the index of the new joined dataFrame. Second, calculate the ratio of readers to population. Third, find the maximum ratio and return the index which is a city.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
