0

[![enter image description here][1]][1]

Hello, I am getting an error as it can be seen in the codes. I couldn't find a solution, how can I solve it?

import os
import warnings
warnings.filterwarnings('ignore')

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
from pylab import rcParams
rcParams['figure.figsize'] = 10,6
from statsmodels.tsa.stattools import adfuller
from statsmodels.tsa.seasonal import seasonal_decompose
from statsmodels.tsa.arima_model import ARIMA
from pmdarima.arima import auto_arima
from sklearn.metrics import mean_squared_error, mean_absolute_error
import math
import yfinance as yf
from yahoofinancials import YahooFinancials

result = seasonal_decompose(df_close, model='multiplicative', freq = 30)
fig = plt.figure()  
fig = result.plot()  
fig.set_size_inches(16, 9)
bozkurt
  • 1
  • 2
  • 1
    From where did you get `seasonal_decompose` ? Did you import it from some library or defined a function/class with that name? Can you show what's on line 1? Please add code instead of an image. – Shiva Jan 08 '21 at 11:07
  • 1
    https://stackoverflow.com/questions/47609537/seasonal-decompose-in-python – Subbu VidyaSekar Jan 08 '21 at 11:10
  • 1
    Does this answer your question? [seasonal decompose in python](https://stackoverflow.com/questions/47609537/seasonal-decompose-in-python) – Subbu VidyaSekar Jan 08 '21 at 11:11

1 Answers1

1

You need to import it:

from statsmodels.tsa.seasonal import seasonal_decompose
tyler
  • 91
  • 8