Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import random
- def func(in_vals):
- '''result = x (+y+z+w....)'''
- result = 0
- for v in in_vals:
- result += v
- return result
- if __name__ == "__main__":
- entry_count = 1000
- dim_count = 2
- in_vals = [0]*dim_count
- with open("data_yequalsx.csv", "w") as out_file:
- for entry in range(entry_count):
- for i in range(dim_count):
- in_vals[i] = random()
- out_val = func(in_vals)
- out_file.write(','.join([str(x) for x in in_vals]))
- out_file.write(",%s\n" % str(out_val))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement