MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Reshaping Data with pandas

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Reshape wide to long using title as index and version as new name, and extracting isbn prefix 
isbn_long = pd.____(____, 
                    stubnames=____, 
                    i=____, 
                    j=____)

# Print isbn_long
print(isbn_long)
Edit dan Jalankan Kode