aca-tasks/task1/dataset-gen.py
2023-11-01 10:00:36 +01:00

14 lines
421 B
Python

import numpy as np
import os
randomizer = np.random.default_rng(42)
randvec = randomizer.integers(low=0, high=pow(2, 32), size=pow(10, 7))
print("Generated random vector with {} entries".format(randvec.size))
with open("dataset.dat", "w") as file:
for value in randvec:
file.write(str(value) + '\n')
fsize = os.path.getsize("dataset.dat")
print("File written down with Size {} MB".format(fsize/1000/1000))