INNER CODE UNIT · Python
prepareInput
adminho/trading-stock-thailand · DeepQ_trade.py:92
def prepareInput(self, all_data, index):
# get sequence of data
if len(all_data) < index + self.num_sequence: # index out of bound
return None
else:
return all_data[index: index+self.num_sequence]
"""
# for debug only
def createLogHTML(prefix_name, log_path, all_pic):
def _convertListToCode(list):
# convert list to code in string
return "['" + "','".join(map(str, list )) + "']"
list_pic = _convertListToCode(all_pic)
list_pic = list_pic.replace("\\","/")
#output example
# list_pic = ['temp_pic/BBL_0.png', 'temp_pic/BBL_1.png', 'temp_pic/BBL_2.png']
#list_gain = _convertListToCode(all_gain)