python - Value exceptions in Numpy -



python - Value exceptions in Numpy -

i got next excerpt of code:

xmin = -20 xmax = 20 ymin = -20 ymax = 20 x = np.arange(xmin,xmax,0.1) y = np.arange(ymin,ymax,0.1)

i want python steps range of -0.1 0.1. how code this?

thanks in advance. a.

you can utilize boolean indexing on x , y omit values in range -0.1 0.1.

for example:

x[(x < -0.1) | (x > 0.1)]

this gives view of array x in values either less -0.1 or greater 0.1 (i.e. won't contain values -0.1, 0, 0.1).

python numpy

Comments

Popular posts from this blog

c# - ASP.NET MVC Sequence contains no matching element -

java - Parsing XML, skip certain tags -

rest - How to invalidate user session on inactivity in a stateless server? -