1. Learn
  2. /
  3. Courses
  4. /
  5. Reshaping Data with pandas

Exercise

International caller

You have a new task. You will analyze the pattern of customers on international and domestic calls.

You explore the churn dataset, which contains a multi-level row index. Again, you will reshape the data, as you expect it will help you to do further analysis.

The DataFrame churn is available for you. It contains data about minutes, calls, and charge for different times of the day, types of calls, and exited status. Make sure to examine it in the console!

Instructions 1/3

undefined XP
  • 1

    Reshape the churn DataFrame by unstacking the last row level. Assign it to churn_unstack.

  • 2

    Create a reshaped DataFrame called churn_first by unstacking the first row level of churn.

  • 3

    Define a new DataFrame called churn_second by unstacking the second row level of churn.