Skip to content
This repository was archived by the owner on Jun 12, 2019. It is now read-only.

Commit 3aa18e2

Browse files
author
Tyler Hutcherson
authored
Update prediction date format,
1 parent 818a13f commit 3aa18e2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
## Import some needed dependencies
77
import os
8-
from datetime import datetime
8+
from datetime import datetime, timedelta
99
import pandas as pd
1010
import numpy as np
1111
import quandl
@@ -200,12 +200,13 @@ def unnormalize(x):
200200

201201
# Get the prediction and date value
202202
predicted_price = (predicted_value + 1)*previous_close_price
203-
prediction_date = pd.to_datetime(day_index_map.get(last_day), "%Y-%m-%d")
203+
prediction_date = pd.to_datetime(day_index_map.get(last_day), "%Y-%m-%d").date() \
204+
+ timedelta(days=1)
204205

205206
print("The RNN predicts the closing price for: \n%s to be %s $" % (prediction_date, predicted_price), flush=True)
206207

207208
data_out = [{'price_prediction': predicted_price,
208-
'date': prediction_date.date(),
209+
'date': prediction_date,
209210
'date_updated': datetime.strftime(datetime.now(), "%Y-%m-%d %H:%M:%S"),
210211
'coin': 'bitcoin'}]
211212

0 commit comments

Comments
 (0)