Esempio n. 1
0
 def save_stock(self, stock):
     with open("dataset/" + stock + ".csv", 'w+') as file:
         file.write("date,open,max,min,close,volume,y\n")
         prep = Preprocessing()
         close = np.array(self.data[stock])[:, 4]
         y = prep.create_train_result(close)
         for index in range(len(y)):
             x = ",".join([str(i) for i in self.data[stock][index]])
             file.write(x + "," + str(y[index]) + "\n")