コード例 #1
0
 def testNumpyAverageMixTypesValueArray(self):
     npsy = NumpySciPy()
     multiArray = [[0.01,1],[0.01,1]]
     actual = npsy.numpyAverage(multiArray)
     expected = 0.505
     self.assertEqual(expected,actual)
コード例 #2
0
 def testNumpyAverageOneValueArray(self):
     npsy = NumpySciPy()
     multiArray = [[1,2],[1,2]]
     actual = npsy.numpyAverage(multiArray)
     expected = 1.5
     self.assertEqual(expected,actual)
コード例 #3
0
 def testNumpyAverageEmptyArray(self):
     npsy = NumpySciPy()
     emptyArray = []
     isNaN = np.isnan(npsy.numpyAverage(emptyArray))
     self.assertTrue(isNaN)
コード例 #4
0
 def testNumpyAveragetwoValueArray(self):
     npsy = NumpySciPy()
     emptyArray = [[1,2]]
     actual = npsy.numpyAverage(emptyArray)
     expected = 1.5
     self.assertEqual(expected,actual)
コード例 #5
0
 def testNumpyAverageOneOffValueArray(self):
     npsy = NumpySciPy()
     multiArray = [[0.01,1],[1,4]]
     actual = npsy.numpyAverage(multiArray)
     expected = 1.5025
     self.assertEqual(expected,actual)