I'm trying to generate 1,000,000 random numbers and timeit 10 times to compare vs numpy. Numpy part of gode is working put random shows errors.
Here is the code:
import numpy as np
import random as ra
def f1():
rands = {i:np.random.randn() for i in range(100000)}
%timeit -n 10 f1()
def f2():
rands = {j:ra.random.random(0,100000)}
%timeit -n 10 f2()
Aucun commentaire:
Enregistrer un commentaire