def deviation_Calculator(data): newdata = [] data.sort() n = len(data) mean = Mean.Mean_Calculator(data) for i in data: newdata.append(Exponentiation.power((i - mean),2)) sum = Addition.sumList(newdata) return nthRoot.rooting(2,Division.divide(sum,n))
def meanDev(data): newlist = [] meanOfData = Mean.mean(data) for i in data: newlist.append(abs(i - meanOfData)) total = Addition.sumList(newlist) return Division.divide(total, len(data))
def stardardDev(data): n = len(data) mn = Mean.mean(data) newlist = [] for i in data: newlist.append(Exponentiation.power(i - mn, 2)) total = Addition.sumList(newlist) return nthroot.root(2, Division.divide(total, n))
def divide(self, a, b): self.Result = Division.divide(a, b) return self.Result
def Quotient(self, a, b): self.Result = Division.quotient(a, b) return self.Result
def mean(data): num_values = len(data) total = 0 for num in data: total = Addition.sum(total, num) return Division.divide(total, num_values)
def Mean_Calculator(data): num = len(data) count = Addition.sumList(data) return Division.divide(count, num)
def test_MO_div(self): self.assertEqual(2, Division.divide(2, 1))
def zscore(sd, data): X = PickSeed.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(2, Division.quotient(4, 2))
def mean(data): num = len(data) total = Addition.sumList(data) return Division.divide(total, num)