random walk - Numpy array comparing 2 arrays element wise with increasing offset of indicies -
This is a version of the problem of random walking using numpy arrays here only 500 times again. To do this, we have to compare a sort array of situations with our offset, close that time and increase the offset.
So far my code is, the problem is in 'when' loop, where I am reviewing the situation in the form of elements in 'ZeroAir', trying to store the last time. / P>
When I run it, I get an indicative error, no results were recorded and a counter that is repeated several times, though the loop has changed to prevent Boolean expression .
Edit: How to obtain a duplicated status with numpy array: 1) Sort the last position array in ascending order. 2) Compare slices with edge offset until you find the post within 0.001 m on that offset, then you compare the position of neighboring posts (offset 1). You can get 18 cases, where in neighboring math two places you can get only two cases. And in three places you will get 0 point. Thanks for any help , You can directly contrast your posts vector against yourself: Now, To get a close position, you can do the following: get rid of as an example: deltas = np.abs (status [none,] - status [:, none]] E
deltas [i, j] step
i and the term
j is the distance between the positions. You can get your hit by:
hits = deltas & lt; = TOLERANCE
line, col = np.nonzero (hit) idx = Line & lt; Colonel # diagonal and upper triangular part line = line [idx] col = col [idx]
& gt; & Gt; & Gt; Position = genotype (NUM_STEPS, MAX_STEP_SIZE) & gt; & Gt; & Gt; Line, col = np.nonzero (np.abs (status [none ,:] - ... condition [:, none])
Comments
Post a Comment