I have a collection of data on which i would like to apply while loop but i got an error
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
import numpy as np
data = np.loadtxt('data4.txt')
i=np.array(data[:,1]) #column having thousand values
j=7/2
f = i-j
while f <= i+j:
print(f)
f = f+1
if 10 <= [2, 4, 6, 8, 10, 12]
. How is that to be interpreted? - roganjoshi+j
in that? Maybe(i-j)+2j
? But anyway, you're still applying that to an array, so your intent is not clear to me. Should it stop when one value in that array crosses the threshold, or all of them? We can't see your input data. - roganjosh