python : Updated code with better display, documentation and format_time
This commit is contained in:
@ -5,6 +5,9 @@ from sys import argv
|
||||
import numpy as np
|
||||
from os import path, listdir
|
||||
|
||||
# Induce determinism
|
||||
np.random.seed(133742)
|
||||
|
||||
# Makes the "leave" argument default to False
|
||||
tqdm = partial(tqdm, leave = False)
|
||||
|
||||
@ -42,8 +45,8 @@ def __main__(data_path: str) -> None:
|
||||
y.append(y_i)
|
||||
|
||||
X, y = np.asarray(X), np.asarray(y)
|
||||
# idx = np.random.permutation(y.shape[0])
|
||||
# X, y = X[idx], y[idx]
|
||||
idx = np.random.permutation(y.shape[0])
|
||||
X, y = X[idx], y[idx]
|
||||
|
||||
for org, s in tqdm(zip("Xy", [X, y]), desc = f"Writing {set_name}"):
|
||||
with open(f"{data_path}/{org}_{set_name}.bin", "w") as out:
|
||||
|
Reference in New Issue
Block a user