@st.cache
def train_model(data, currency, period):
    df_train = data[['date(y-m-d)', currency]]
    df_train = df_train.iloc[((- 365) * 2):]
    df_train = df_train.rename(columns={'date(y-m-d)': 'ds', currency: 'y'})
    m = Prophet()
    m.fit(df_train)
    future = m.make_future_dataframe(periods=period)
    forecast = m.predict(future)
    return (forecast, m)
@st.cache
def train_model(data, currency, period):
    df_train = data[['date(y-m-d)', currency]]
    df_train = df_train.iloc[((- 365) * 2):]
    df_train = df_train.rename(columns={'date(y-m-d)': 'ds', currency: 'y'})
    m = Prophet()
    m.fit(df_train)
    future = m.make_future_dataframe(periods=period)
    forecast = m.predict(future)
    return (forecast, m)