Search code examples
numpytensorflowodenumpy-slicing

Slice indices must integer


I am working on ODE circuit suddenly face this problem . How to solve it ?

enter image description here


Solution

  • Most probably, if your N/2 is not an integer, you get such an error.

    I would change to w[0:int(N/2)+1] = 2....

    This is also available for every place you divide N/2.