Browse Source

Ex0.2: Random Numbers with Numpy

master
Eric Teunis de Boone 2 years ago
parent
commit
119c90e36e
  1. 11
      ex0.2/gen_rand.py
  2. 4
      ex0.2/results.txt

11
ex0.2/gen_rand.py

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import numpy as np
import sys
N = 1e6
if len(sys.argv) > 1:
N = float(sys.argv[1])
print( np.random.rand( int(N) ) )

4
ex0.2/results.txt

@ -0,0 +1,4 @@
Running `time ./gen_rand.py "1e9"` gives
real 0m13.803s
user 0m8.874s