예제 #1
0
파일: Generator.py 프로젝트: imaxus/pite
import random
import numpy as np
from Calculator import calc
from FileWriter import *
n = int(raw_input("Please write the number of samples \n"))
m = int(raw_input("Please write the number of numbers in one sample \n"))
s_zakres = float(
    raw_input("Please write the lowest random number You want \n"))
e_zakres = float(
    raw_input("Please write the highest random number You want \n"))

rnd_numbers = [[random.uniform(s_zakres, e_zakres) for k in range(m)]
               for i in range(n)]
write_gen_to_file(rnd_numbers)
write_mean_to_file(calc(rnd_numbers))
예제 #2
0
 def test_230(self):
     self.assertEquals("JAM!", calc("CODE", "O!CDE?", "A?JM!."))
예제 #3
0
 def test_210(self):
     self.assertEquals("9", calc("Foo", "oF8", "0123456789"))
예제 #4
0
 def test_220(self):
     self.assertEquals("10011", calc("13", "0123456789abcdef", "01"))
예제 #5
0
파일: Generator.py 프로젝트: imaxus/pite
import random
import numpy as np
from Calculator import calc
from FileWriter import *
n = int(raw_input("Please write the number of samples \n"))
m = int(raw_input("Please write the number of numbers in one sample \n"))
s_zakres = float(raw_input("Please write the lowest random number You want \n"))
e_zakres = float(raw_input("Please write the highest random number You want \n"))

rnd_numbers = [[random.uniform(s_zakres, e_zakres) for k in range(m)] for i in range(n)]
write_gen_to_file(rnd_numbers)
write_mean_to_file(calc(rnd_numbers))