-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.py
45 lines (40 loc) · 944 Bytes
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import numpy as np
from pyfiglet import figlet_format
import stem_plot as sp
# generate distributions
distributions = {
'Gaussian': {
'sample': np.random.normal(size=1500, loc=100, scale=15),
'scale': 1,
'step': 5,
'font': 'banner4'
},
'Exponential': {
'sample': np.random.exponential(scale=1.0, size=1000),
'scale': 0.01,
'step': 1,
'font': 'jazmine'
},
'Gamma': {
'sample': np.random.gamma(shape=5.0, scale=1.0, size=1500),
'scale': 0.1,
'step': 4,
'font': 'alligator2'
},
'Beta Arcsine': {
'sample': np.random.beta(a=0.5, b=0.5, size=1500),
'scale': 0.01,
'step': 5,
'font': 'fender'
},
'Lognormal': {
'sample': np.random.lognormal(mean=0, sigma=1.0, size=1500),
'scale': 0.01,
'step': 1,
'font': 'epic'
}
}
for name, d in distributions.items():
print(figlet_format(name,font=d['font'],width=150))
sp.print_stemplots(sp.stem_plot(list(d['sample']),d['scale'],d['step']))
print("\n")