評分不是一切
你第一次探索 books_gothic 資料集很順利。接下來要做更深入的分析。你需要再次重塑你的 DataFrame。這次,你不想使用所有變數。
為此,你會對 DataFrame 進行 melt,並嘗試以不同欄作為識別與數值變數的多種做法。
你先前使用的同一個 books_gothic 資料集已經幫你載入。它包含每本書的 title、author、number_pages、rating、rating_count 和 publisher 等資料。請務必在主控台檢視一下!
本練習屬於課程
使用 pandas 重塑資料
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Melt publisher column using title and authors as identifiers
publisher_melted = books_gothic.____(____=[____, ____],
value_vars=____)
# Print publisher_melted
print(publisher_melted)