Example #1
0
 def execute(self):
   
     o = OLAP.objects(name=self.olap)[0]
     o.limit = 1
     data = o.execute()[0]
     
     return sum([(data[key] * coeff) for key, coeff in zip(self.inds, self.coeff[1:])]) + self.coeff[0]
Example #2
0
    def getData(self):
        
        o = OLAP.objects(name=o.name)[0]
        rawData = o.execute()
        
        i = []
        d = []
        
        for r in rawData:
            row = [ r[k] for k in self.inds ]
            i.append(row)            
            d.append(r[self.dep])  

        return [d, i]