ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Reshaping Data with pandas

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# 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)
Editar y ejecutar código