對 airline 資料集做時間序列分解
在這個練習中,你會對 airline 資料集進行時間序列分解,並視覺化其中的 trend 與 seasonal 成分。
本練習屬於課程
使用 Python 視覺化時間序列資料
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Import statsmodels.api as sm
____
# Perform time series decompositon
decomposition = sm.tsa.____(____)
# Extract the trend and seasonal components
trend = ____
seasonal = ____