0
is_bid_unique = (len(np.unique(bus.loc[:,'bid']))==len(bus.loc[:,'bid']))

My code above returns False when you call is_bid_unique, but returns -1 when you call ~is_bid_unique. Why is this and how can I fix this?

bco
  • 1
  • 2
  • 6
    Using `~` (bitwise not) on a boolean converts it into a number object. `False` becomes `0`, and `~0` is `-1` (i.e. `~00...00` is `11...11`). Do you mean to use the logical not operator, `not`? – Brian61354270 Feb 16 '20 at 21:07
  • https://stackoverflow.com/questions/21881362/why-does-true-result-in-2 – Maroun Feb 16 '20 at 21:10

0 Answers0