def Mean(data): num_values = len(data) total = 0 for num in data: total = Addition.addition(total, num) return Division.divide(total, num_values)
def zscore(sd, data): X = PickSeedList.pickSeed(sd, data) meanData = Mean.Mean(data) sd = StandardDeviation.standardDeviation(data) z = Division.divide(X - meanData, sd) return z
def test_MathOperations_division(self): self.assertEqual(3, Division.divide(9, 3))
def test_MathOperations_divide_list(self): dividend = 16 divisor = 2 result = Division.divide(dividend, divisor) self.assertEqual(8, result)
def Division(self, a, b): self.Result = Division.divide(a, b) return self.Result