September 2018
Intermediate to advanced
296 pages
9h 10m
English
In this script, we will create functions that will be helpful for training, via the following steps:
import numpy as npimport math
def formatPrice(n): if n>=0: curr = "$" else: curr = "-$" return (curr +"{0:.2f}".format(abs(n)))
def getStockData(key): datavec = [] lines = open("data/" + key + ".csv", "r").read().splitlines() for line in lines[1:]: datavec.append(float(line.split(",")[4])) return datavec
Read now
Unlock full access