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

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -