DataPipeline/Utilities.py
def createTempData(fname, names, slope, noise=0.2):
    """Create some simulated linear data with noise as a function of temp"""

    cw = csv.writer(open(fname,'w'))
    cw.writerow(['temp']+names)
    for x in range(250,360,2):
        vals = [round(slope*x/random.normalvariate(10,noise),2) for j in range(len(names))]
        vals.insert(0,x)
        cw.writerow(vals)
    return
Create some simulated linear data with noise as a function of temp
Create some simulated linear data with noise as a function of temp
Create some simulated linear data with noise as a function of temp
def createTempData(fname, names, slope, noise=0.2):
    cw = csv.writer(open(fname,'w'))
    cw.writerow(['temp']+names)
    for x in range(250,360,2):
        vals = [round(slope*x/random.normalvariate(10,noise),2) for j in range(len(names))]
        vals.insert(0,x)
        cw.writerow(vals)
    return
def createTempData ( fname , names , slope , noise = 0.2 ) : cw = csv . writer ( open ( fname , 'w' ) ) cw . writerow ( [ 'temp' ] + names ) for x in range ( 250 , 360 , 2 ) : vals = [ round ( slope * x / random . normalvariate ( 10 , noise ) , 2 ) for j in range ( len ( names ) ) ] vals . insert ( 0 , x ) cw . writerow ( vals ) return
Create some simulated linear data with noise as a function of temp
Create some simulated linear data with noise as a function of temp
"""Create some simulated linear data with noise as a function of temp"""
fname
names
slope
noise