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

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

Running the code in Python 3.6 #14

Open Bellman281 opened 6 years ago

Bellman281 commented 6 years ago

I changed lstm.py code , so I can test it on Python 3.6: change xraneg to range.
change range(len(data)/prediction_len): to range(len(data)//prediction_len): I got this error: TypeError: %i format: a number is required, not list

any help please

Bellman281 commented 6 years ago

issue solved! thanx

Sir-Jaybob commented 6 years ago

Thanks for this post, was having the same issue with that range line. Cheers!

dewmal commented 6 years ago

@Bellman281 How did you solve that issue.

MartinMacek commented 5 years ago
  1. Replace all xrange to just range
  2. Use two // in range(len(data)//prediction_len):

note: I had to do it manualy in different editor, then save it and restart the script in jupyter

MoAfshar commented 4 years ago

"TypeError: %i format: a number is required, not list" still exists after those changes. Anyone else experience this?

SungchulLee commented 2 years ago

Instead of range(len(data)//prediction_len), I use range(int(len(data)/prediction_len)). I think both should work.