def udpate(self): data = {} for key in self.keys: data[key] = [] for r in Lottery.getRecordByDay(self.day): for key in self.keys: data[key].append(getattr(r, key)) for key in self.keys: data[key].reverse() setattr(self, key, data[key])
def analyzeOneDay(date, dataType="one"): data = [record[dataType] for record in Lottery.getRecordByDay(date)] oddRet, evenRet, splitRet = classfiyData(data) return oddRet, evenRet, splitRet, data