Beispiel #1
0
    def more_often_dozen (self):
        """
        """
        for each in self.all_content:
            d = 0
            for el in each['Dozens']:
                d = utils.dozen(int(el))

                if d == 0:
                    self.doze['0x'].append(int(each['Number']))
                elif d == 1:       
                    self.doze['1x'].append(int(each['Number']))
                elif d == 2:       
                    self.doze['2x'].append(int(each['Number']))
                elif d == 3:       
                    self.doze['3x'].append(int(each['Number']))
                elif d == 4:       
                    self.doze['4x'].append(int(each['Number']))
                elif d == 5:       
                    self.doze['5x'].append(int(each['Number']))
                elif d == 6:       
                    self.doze['6x'].append(int(each['Number']))
                elif d == 7:       
                    self.doze['7x'].append(int(each['Number']))
                elif d == 8:       
                    self.doze['8x'].append(int(each['Number']))
Beispiel #2
0
 def more_often_dozen (self):
     """
     """
     for each in self.all_content:
         d = 0
         for el in each['Dozens']:
             d = utils.dozen(int(el))
             self.doze[str(d) + 'x'].append(int(each['Number']))
Beispiel #3
0
    def more_often_dozen (self):
        """
        """
        for each in self.all_content:
            d = 0
            for el in each['Dozens']:
                d = utils.dozen(int(el))

                if d == 0:
                    self.doze['0x'].append(int(each['Number']))
                elif d == 1:       
                    self.doze['1x'].append(int(each['Number']))
                elif d == 2:       
                    self.doze['2x'].append(int(each['Number']))
Beispiel #4
0
    def suggest_num(self, method='Score', for_print=True):
        """
        """

        result = {}
        st = 'x'
        for ind, val in enumerate(self.all_stat):
            num = ind + 1
            if num < 10:
                el = '0' + str(num)
            else:
                el = str(num)

            if method == 'Most Recently':
                result[el] = val['More']/100 - val['Last']/10 #
            elif method == 'Least Recently':
                result[el] = val['More']/100 + val['Last']/10 #
            elif method == 'Score':
                result[el] = val['More']/100 - val['Std_Sco']*2 #

            try:
                result[el] += val['Freq'][str(val['Last'])]
            except KeyError:
                result[el] += 0

            doz = utils.dozen(num)
            result[el] += len(self.doze[str(doz)+st])/1000 #Weight 1/10

            uni = utils.ret_unit(num)
            result[el] += len(self.unit[st+str(uni)])/1000 #Weight 1/10

            sorted_list = sorted(result.items(), key=operator.itemgetter(1), reverse=True)
        if for_print:
            print('##################### MORE OFTEN #####################')
            self.prepare_to_print('More')
            print('################## MORE OFTEN DOZENS #####################')
            self.print_more_often_dozen()
            print('################## MORE OFTEN UNITS #####################')
            self.print_more_often_unit()
            print('################# SUGGESTED NUMBERS #####################')
            print(sorted_list)
        else:
            return sorted_list