Get startedGet started for free

What's your rating, Harry?

You fix yourself a coffee and keep working on your book project. For your next task, you need to get an appropriate dataset containing ratings for all the Harry Potter books. You gathered data from Goodreads as well as from Amazon.

You realized that you need a long format, but the dataset hp_books is in a wide format. You want to melt the data, but first, you need to manipulate some of the string columns.

The full title is divided into two columns. The authors column contains info about the writer and the illustrator.

Ratings for the Harry Potter books are in the DataFrame hp_books. Make sure to examine it in the console!

This exercise is part of the course

Reshaping Data with pandas

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Concatenate the title and subtitle separated by "and" surrounded by spaces
hp_books['full_title'] = ____[____].____.____(____, sep =____) 

# Print hp_books
print(hp_books)
Edit and Run Code