LoslegenKostenlos loslegen

Gothic times

You have a new project! Your boss has asked you to perform an analysis with a dataset of books. You have several tasks to complete. Your first task is to analyze Gothic fiction books.

The dataset books_gothic is in a wide format. Any analysis will require you to reshape the data into a long format. To that aim, you will melt your dataset. You will reshape the dataset using several variables as identifiers to decide which is the best format.

The books_gothic dataset is available for you. Make sure to examine it in the console!

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.

# Melt books_gothic using the title column as identifier 
gothic_melted = books_gothic.____(id_vars=____)

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