def header(self,cells): self = self or Rows() self.indep = [] for c0,x in enumerate(cells): if not "?" in x: c = len(self._use) self._use.append(c0) self.name.append(x) if "$" in x or "<" in x or ">" in x: n1 = Num() self.nums[c] = n1.nums([]) else: s1 = Sym() self.syms[c] = s1.syms([]) if "<" in x: self.w[c] = -1 elif ">" in x: self.w[c] = 1 elif "!" in x: self._class = c else: self.indeps.append(c) return self
def testing_Num(): n1 = Num() n1 = n1.nums([ 4, 10, 15, 38, 54, 57, 62, 83, 100, 100, 174, 190, 215, 225, 233, 250, 260, 270, 299, 300, 306, 333, 350, 375, 443, 475, 525, 583, 780, 1000 ]) print(n1.mu, n1.sd) assert (n1.mu == 270.3) result = round(n1.sd, 3) assert (result == 231.946)
def num_test(): """ Testing num.py ... """ num = Num(30) num_list = [ 4, 10, 15, 38, 54, 57, 62, 83, 100, 100, 174, 190, 215, 225, 233, 250, 260, 270, 299, 300, 306, 333, 350, 375, 443, 475, 525, 583, 780, 1000 ] num.nums(num_list) print() print('MU', ':', num.mean) print('SD', ':', num.standard_deviation) assert close(num.mean, 270.3) assert close(num.standard_deviation, 231.946) print()