I read numerous similar posts about the subject here but still cannot make anything out of this.
I have this simple list:
mask =[False, False, False, False, True, True, False]
And am attempting to negate this list via the ~ operator (this is the exercise I have been given). Though:
neg_mask = ~mask
gives me the following error:
TypeError Traceback (most recent call last)
<ipython-input-111-b1d572533400> in <module>
----> 1 neg_mask =~mask
TypeError: bad operand type for unary ~: 'list'
Tried on python and ipython 3. Well, according to the instructions this is supposed to work.