def testOneColumn(self): inarray = [[0.], [1.], [1.], [0.]] coeff = [[0.7, 0.15]] n = _normarray(inarray, coeff) for i in xrange(4): self.assertAlmostEqual(n[i, 0], coeff[0][0] * inarray[i][0] + coeff[0][1], 8)
def testOneColumn(self): inarray = [[0.], [1.], [1.], [0.]] coeff = [[0.7, 0.15]] n = _normarray(inarray, coeff) for i in xrange(4): self.assertAlmostEqual(n[i,0], coeff[0][0]*inarray[i][0] + coeff[0][1], 8)
def testEmpty(self): inarray = [[], []] n = _normarray(inarray, []) for i in xrange(len(n)): self.assertEqual(n[i].tolist(), [])