開始使用免費開始

為分面網格圖準備資料

在這個練習中,你會先準備資料來製作下圖: This plot shows the gross margin of tech companies, FMCG companies, the average tech company, and the average FMCG companies over many years. 在下一個練習,你將實作繪圖。這張圖可以清楚觀察到:

  • 科技公司的毛利率分佈比 FMCG 公司更分散。
  • 每年各家公司相較於其產業平均的獲利能力。

pandas 已以別名 pd 載入,seaborn 已以別名 sns 載入。已為你載入一個 pandas 的 DataFrame dataset,其中已計算好 gross_margin 欄位。

本練習屬於課程

使用 Python 分析財務報表

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Subset tech and fmcg companies
subset_dat = dataset.loc[____]
編輯並執行程式碼