I have array data, (T). T is temperature as function of time (t) and height (h). I want to pick values of T in the particular height, for example, in 100 km height and then plot it in 2D graphic. Why this loop didn't work?
for j in range(len(tim1)):
for i in range(len(height1)):
if height1 == 350. :
print(i,j,T)
error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 540, in runfile
execfile(filename, namespace)
if height1 == 350. :
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Could someone help me? Thank you in advance
height1is an array,==in numpy produces an array of booleans, and you can't test that result for truthiness directly.Tanywhere here.