【发布时间】:2018-07-26 16:43:37
【问题描述】:
我想知道 1024 长度数组中包含的任何值是否大于值 1.2。我找到了数组的中值及其 1.1,所以我知道数组包含高于和低于 1 的值。我正在使用的代码如下所示,我得到的结果消息是“否信号存在”。
if in1_norm.any()>=1.2: ## Comparison of array to threshold. Using
## a generic value for now
print "A signal is present"
else:
print "No signal is present"
我在上一篇文章中读到 any() 的计算结果为 1 或“真”,因此,我相信我没有得到正确的结果,因为比较被视为 1>=1.2,即假的。有没有其他方法可以做到这一点??
谢谢
【问题讨论】: