我有数组数据,(T)。T是温度随时间(T)和高度(h)的变化。我想在特定的高度上选取T的值,例如,在100公里的高度上,然后在二维图形中绘制它。 为什么这个循环不起作用?你知道吗
for j in range(len(tim1)):
for i in range(len(height1)):
if height1 == 350. :
print(i,j,T)
错误:
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()
有人能帮我吗?先谢谢你
我可能误解了这个问题,但您可能只需要确保在测试条件时正在索引列表:
相关问题 更多 >
编程相关推荐