農園ちょっと素人な統計部???? 〜3月編〜 (52)

←← 掲示板一覧に戻る ← スレッド一覧に戻る

36 野に咲く名無し@転載禁止 2024/03/01 (金) 22:54:36.647 ID:67r4OKEOr

>>33続き
hourly_counts = df.resample("h", on="date").size()
import statsmodels
from statsmodels.tsa.seasonal import STL
import matplotlib.pyplot as plt

hourly_counts.plot()

# 1時間ごとなので24分割
stl = STL(hourly_counts, period=24, robust=True)
stl_series = stl.fit()

stl_series.plot()
plt.show()