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

Connected

Exercise

The golden age

In this exercise, you'll continue working on the book project. Now, you'll analyze books from the Golden Age.

Upon inspection, you discovered that the dataset golden_age needs reshaping. You noticed that some column names start with the same prefix (stub names) and identified other columns to use as unique IDs.

For that reason, you'll reshape your DataFrame in several ways. Use the function wide_to_long() along with each instruction.

The golden_age dataset is available for you. It contains the title, authors, and data about the universal identifier ISBN and prefix for countries of each book.

Instructions 1/3

undefined XP
  • 1

    Set title as the unique index. Extract the prefix from isbn10 and isbn13. Name the new variable created version.

  • 2

    Set title and authors as the index. Get the prefix from prefix10 and prefix13. Name the new variable version.

  • 3

    Set title and authors as unique indexes. Extract the prefixes isbn and prefix. Name the new variable version.