【发布时间】:2021-04-19 22:31:20
【问题描述】:
index = np.where(slopes > mean - 2 * sd and slopes < mean + 2 * sd)[0]
返回此错误:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
如果我改为写idx = np.where(slopes < mean + 2 * sd)[0] 或idx = np.where(slopes > mean - 2 * sd)[0],我会得到正确的索引。为什么我不能同时结合这两个条件?
【问题讨论】: