Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import datetime
- # Plotting data
- df.dropna(inplace=True)
- df['forecast'] = np.nan
- last_date = df.iloc[-1].name
- last_unix = last_date.timestamp()
- one_day = 86400
- next_unix = last_unix + one_day
- for i in forecast_prediction:
- next_date = datetime.datetime.fromtimestamp(next_unix)
- next_unix += 86400
- df.loc[next_date] = [np.nan for _ in range(len(df.columns)-1)]+[i]
- df['close'].plot(figsize=(15,6), color="green")
- df['forecast'].plot(figsize=(15,6), color="orange")
- plt.legend(loc=4)
- plt.xlabel('Date')
- plt.ylabel('Price')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement