[How to Fix]The truth value of a series is ambiguous

The truth value of a series is ambiguous

It is estimated that you are using pandas when this problem occurs. If so, congratulations on finding a solution. Ha ha~

#General Purpose Example

FI_lasso[(FI_lasso["columns"]<0.001) and (FI_lasso["columns"]>=0)]

If you also encounter such a problem, Congratulations, the solution is very simple

The core meaning is to use & amp; instead of and or
for logical judgment in dataframe|

Like this


FI_lasso[(FI_lasso["columns"]<0.001) & (FI_lasso["columns"]>=0)]

Solve the problem and leave~

Read More: