Re: numpy indexing performance

2017-03-21 Thread Olaf Dietrich
Olaf Dietrich : > This is a simplified example of a Monte Carlo > simulation where random vectors (here 2D vectors, > which are all zero) are summed (the result is in > r1 and r2 or r, respectively): > > def case1(): > import numpy as np > M = 10 > N = 1 > r1 = np.zeros(M)

numpy indexing performance

2017-03-15 Thread Olaf Dietrich
This is a simplified example of a Monte Carlo simulation where random vectors (here 2D vectors, which are all zero) are summed (the result is in r1 and r2 or r, respectively): def case1(): import numpy as np M = 10 N = 1 r1 = np.zeros(M) r2 = np.zeros(M) s1 = np.zer