我想寻找一个数组里面等于0或者等于-0(数组里面存在-0.000),报错了,不太明白错误的原因,请教一下。
mask = lasso.coef_ != 0 or lasso.coef_ != -0
Traceback (most recent call last):
File "<ipython-input-143-9eb9383f82c6>", line 1, in <module>
mask = (lasso.coef_ != 0) or (lasso.coef_ != -0)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()