yEst = 0
yEstArray = []
for i in drange2(0, 2 * math.pi + 0.0634665182543392, 0.0634665182543392):
    for x in range(1, N + 1):
        yEst = yEst + a * cos(x * i)
yEstArray.append(yEst)
Write data to a file in Python