tra-analysis/data analysis/generate_data.py

17 lines
337 B
Python
Raw Normal View History

2018-11-07 03:56:51 +00:00
import random
def generate(filename, x, y, low, high):
file = open(filename, "w")
2018-11-14 21:48:49 +00:00
for i in range (0, y, 1):
2018-11-07 03:56:51 +00:00
temp = ""
for j in range (0, x - 1, 1):
temp = str(random.uniform(low, high)) + "," + temp
temp = temp + str(random.uniform(low, high))
file.write(temp + "\n")