Files
MPL-tasks/lab1/gen_data.py
2025-10-23 12:49:30 +10:00

25 lines
425 B
Python

import numpy as np # numpy's random is usualy much faster
import random
OUT_FOLDER= "./data"
LINE_COUNT=500001
CHUNK_SIZE=5000
category_list=list("ABCD")
for file_num in range(5):
with open(OUT_FOLDER+f"/rand_{file_num}.csv","w"):
i=0
while i < LINE_COUNT:
i+=min(CHUNK_SIZE, LINE_COUNT-i)
numbers=np.random.random_integers(0,4)