예제 #1
0
    def testCumProd(self):
        na = np.linspace(1,10,10)
        pda = ak.array(na)

        self.assertTrue((np.cumprod(na) == ak.cumprod(pda).to_ndarray()).all())
        with self.assertRaises(TypeError) as cm:
            ak.cumprod([range(0,10)])
        self.assertEqual('type of argument "pda" must be arkouda.pdarrayclass.pdarray; got list instead', 
                        cm.exception.args[0])  
예제 #2
0
    def testCumProd(self):
        pda = ak.linspace(1,10,10)
        result = ak.cumprod(pda) 

        self.assertIsInstance(result, ak.pdarray)
        self.assertEqual(10, len(result))
        self.assertEqual(float, result.dtype)
        
        with self.assertRaises(TypeError) as cm:
            ak.cumprod([range(0,10)])
        self.assertEqual('type of argument "pda" must be arkouda.pdarrayclass.pdarray; got list instead', 
                        cm.exception.args[0])