Dec-20-2017, 08:50 PM
I have a problem where, I'm trying to use an if loop inside of a while loop to create an array. Its running infinitely.
Anyone see my problem?
import numpy as np x = np.linspace(1, 100, num = 100) def append(start, stop, change): s = ([]) x = 0 while x <= 10: if x < start: s = np.append(s, 0) x = x + 0.01 elif start <= x <= stop: s = np.append(s, change) x = x + 0.01 elif x > stop: s = np.append(s, 0) x = 0.01 return s s = append(3, 7, 0.01)