ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

前端 未结 6 2284
独厮守ぢ
独厮守ぢ 2020-11-21 04:59

I just discovered a logical bug in my code which was causing all sorts of problems. I was inadvertently doing a bitwise AND instead of a logical AND

6条回答
  •  无人及你
    2020-11-21 05:26

    if you work with pandas what solved the issue for me was that i was trying to do calculations when I had NA values, the solution was to run:

    df = df.dropna()

    And after that the calculation that failed.

提交回复
热议问题