Remove novice/python namespace
[swc-modular-python.git] / gen-inflammation.py
1 #!/usr/bin/env python
2
3 '''Generate pseudo-random patient inflammation data for use in Python lessons.'''
4
5 import sys
6 import random
7
8 n_patients = 60
9 n_days = 40
10 n_range = 20
11
12 middle = n_days / 2
13
14 for p in range(n_patients):
15     vals = []
16     for d in range(n_days):
17         upper = max(n_range - abs(d - middle), 0)
18         vals.append(random.randint(upper/4, upper))
19     print ','.join([str(v) for v in vals])