把全部合併起來
繼續進行肥胖率專案吧!你將分析不同國家的平均肥胖率百分比。不過這次 obesity DataFrame 多了一個名為 bounds 的欄位。它包含同一國家不同地區可觀察到的最小值與最大值。
你注意到這些值是以清單形式提供,因此需要先轉換這個欄位。你希望把清單中的每個元素展開為新的一列。
obesity DataFrame 已經在你的工作階段中。請務必先在主控台檢視它!
本練習屬於課程
使用 pandas 重塑資料
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Explode the values of bounds to a separate row
obesity_bounds = ____[____].____
# Print obesity_bounds
print(obesity_bounds)