LoslegenKostenlos loslegen

Elementary, dear Watson!

It's Friday, and you are about to finish working on your book project. For your last task, you will analyze data about Arthur Conan Doyle's books.

You realize your dataset, books_sh, needs reshaping. You notice there are columns that can be grouped using a prefix. You identify the columns to use as unique IDs. However, some of these columns contain strings. They need some manipulation before applying a wide to long transformation. You decide some of the strings need splitting to make the DataFrame cleaner.

The books_sh dataset is available for you. It contains the title, and data about version, number_pages, and number_ratings of each book.

Diese Übung ist Teil des Kurses

Reshaping Data with pandas

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Split main_title by a colon and assign it to two columns named title and subtitle 
books_sh[['title', 'subtitle']] = ____[____].____.____(____, ____=____)

# Print books_sh
print(books_sh)
Code bearbeiten und ausführen