開始使用免費開始

對 airline 資料集做時間序列分解

在這個練習中,你會對 airline 資料集進行時間序列分解,並視覺化其中的 trendseasonal 成分。

本練習屬於課程

使用 Python 視覺化時間序列資料

檢視課程

動手互動練習

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

# Import statsmodels.api as sm
____

# Perform time series decompositon
decomposition = sm.tsa.____(____)

# Extract the trend and seasonal components
trend = ____
seasonal = ____
編輯並執行程式碼