mardi 2 juillet 2019

Problem when trying to generate a psuedo-random array/matrix from normally distributed numbers

I am trying to time the generation of psuedo-random arrays in ipython, using random.gauss() and list comprehension in a ubuntu terminal but it kills the environment after pausing for a while the environment is killed and returns to root. I'm doing this to time the difference between a pure Python approach vs using Numpy.

tried on ubuntu VM and Windows.

import random
I = 5000
mat = [[random.gauss(0, 1) for j in range(I)] for i in range(I)]

expected a array with a shape of 5000x5000 instead get killed.




Aucun commentaire:

Enregistrer un commentaire