Session Ready
Exercise

Phone directory index

After reshaping the dataset, you sent it to your colleagues and asked them to fill in some data. Now, they sent the new churn dataset back and you realized that its shape has changed.

Before you go on, you need to do some reshaping again. The dataset contains a multi-level index in the columns. You'd like to have some columns set as the row index. Also, this time you will only stack some levels. You believe it will help you discover some patterns in the data.

The DataFrame churn is available for you. It contains data about state, city, total_day_calls and total_day_minutes during day and night time. Make sure to examine it in the console!

Instructions 1/2
undefined XP
  • 1
  • 2
  • Set the columns city and state as the index of churn, modifying the DataFrame in-place.