temp save
This commit is contained in:
24
lab1/gen_data.py
Normal file
24
lab1/gen_data.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user