前提・実現したいこと
google trendから得た15年分のデータを分析しています。季節成分分解をしたいのですが、エラーが出てしまいます。そのエラーが何を示しているのかがわかりません。どのように改善すればいいですか。
発生している問題・エラーメッセージ
TypeError Traceback (most recent call last) <ipython-input-63-f798796edaaf> in <module>() ----> 1 res = sm.tsa.seasonal_decompose(df, freq=12) 2 ~/anaconda3_420/lib/python3.5/site-packages/statsmodels/tsa/seasonal.py in seasonal_decompose(x, model, filt, freq, two_sided) 70 nobs = len(x) 71 ---> 72 if not np.all(np.isfinite(x)): 73 raise ValueError("This function does not handle missing values") 74 if model.startswith('m'): TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
該当のソースコード
pytrends = TrendReq(hl='ja-JP', tz=360) # Set the search keyword kw_list = ["熱海"] pytrends.build_payload(kw_list, timeframe='2004-01-01 2019-01-01') df = pytrends.interest_over_time() df.plot(figsize=(15, 3), lw=.7) res = sm.tsa.seasonal_decompose(df, freq=12) res.plot()
試したこと
上記のソースコードが試したことのすべてです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。