llSourcell / How-to-Predict-Stock-Prices-Easily-Demo

How to Predict Stock Prices Easily - Intro to Deep Learning #7 by Siraj Raval on Youtube
772 stars 589 forks source link

Bytes-Like Object Required, not 'str' #1

Closed louwjlabuschagne closed 7 years ago

louwjlabuschagne commented 7 years ago

When calling lstm.load_data('sp500.csv', 50, True) in ipython notebooks I get:


TypeError Traceback (most recent call last)

in () 1 #Step 1 Load Data ----> 2 X_train, y_train, X_test, y_test = lstm.load_data('sp500.csv', 50, True) How-to-Predict-Stock-Prices-Easily-Demo/lstm.py in load_data(filename, seq_len, normalise_window) 25 def load_data(filename, seq_len, normalise_window): 26 f = open(filename, 'rb').read() ---> 27 data = f.split('\n') 28 29 sequence_length = seq_len + 1 TypeError: a bytes-like object is required, not 'str'
llSourcell commented 7 years ago

awesome work

josecyc commented 7 years ago

I am getting the error that xrange is not defined. I am using python 3 and have changed from xrange to range. But still it is saying that.

aj-nash commented 6 years ago

Jose, you must have another occurrence of xrange somewhere. There were a few.