示例#1
0
    def test_add(self):
        gaussian_one = Gaussian(25, 3)
        gaussian_two = Gaussian(30, 4)
        gaussian_sum = gaussian_one + gaussian_two

        self.assertEqual(gaussian_sum.mean, 55)
        self.assertEqual(gaussian_sum.stdev, 5)
示例#2
0
from Gaussiandistribution import Gaussian

gaussian_one = Gaussian(22, 2)
print(gaussian_one.mean) 
示例#3
0
 def setUp(self):
     self.gaussian = Gaussian(25, 2)
示例#4
0
from Gaussiandistribution import Gaussian

gaussian_one = Gaussian(20, 3)
gaussian_two = Gaussian(10, 4)

gaussian_three = gaussian_one + gaussian_two

print(gaussian_one.mean, gaussian_one.stdev)
print(gaussian_two.mean, gaussian_two.stdev)

print(gaussian_three.mean, gaussian_three.stdev)

print(gaussian_three)

#gaussian_three   need print command

gaussian_four = Gaussian()
gaussian_four.read_data_file('numbers.txt')
gaussian_four.calculate_mean()
gaussian_four.calculate_stdev()

gaussian_four.plot_histogram_pdf()

gaussian_four.plot_histogram()

gaussian_five = Gaussian(10, 5)
gaussian_five.plot_histogram()

print(gaussian_five)

gaussian_six = Gaussian()
示例#5
0
 def test_repr(self):
     gaussian_one = Gaussian(25, 3)
     self.assertEqual(str(gaussian_one), "mean 25, standard deviation 3")
示例#6
0
from Gaussiandistribution import Gaussian

gaussian_three = Gaussian()
gaussian_three.read_data_file('numbers.txt')

print(gaussian_three.calculate_stdev())
gaussian_three.plot_histogram_pdf()
示例#7
0
from Gaussiandistribution import Gaussian

gaussian_one = Gaussian(20, 2)

gaussian_two = Gaussian(19, 4)

gaussian_three = gaussian_one + gaussian_two

print(gaussian_three.stdev)
print(gaussian_three.mean)
示例#8
0
 def setUp(self):
     self.gaussian = Gaussian(25, 2)
     self.gaussian.read_data_file('numbers.txt')