I have a one-dimensional NumPy array that consists of zeroes and ones like so:
array([0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
I\'d li
There must be something in your Q that i do not understand...
Anyway
In [2]: from numpy import array In [3]: a = array((1,0,0,1,1,0,0)) In [4]: b = 1-a In [5]: print a ; print b [1 0 0 1 1 0 0] [0 1 1 0 0 1 1] In [6]: