I think this is the same as:

```python
11:43:00 (mcdonadt@Daniels-MacBook-Pro-2):/Users/mcdonadt
> a = array([1,2,0,0,1,2])

11:43:17 (mcdonadt@Daniels-MacBook-Pro-2):/Users/mcdonadt
> a == a[:, newaxis]
Out[30]:
array([[ True, False, False, False,  True, False],
       [False,  True, False, False, False,  True],
       [False, False,  True,  True, False, False],
       [False, False,  True,  True, False, False],
       [ True, False, False, False,  True, False],
       [False,  True, False, False, False,  True]], dtype=bool)

11:43:18 (mcdonadt@Daniels-MacBook-Pro-2):/Users/mcdonadt
> where(a == a[:, newaxis], a, -1)
Out[31]:
array([[ 1, -1, -1, -1,  1, -1],
       [-1,  2, -1, -1, -1,  2],
       [-1, -1,  0,  0, -1, -1],
       [-1, -1,  0,  0, -1, -1],
       [ 1, -1, -1, -1,  1, -1],
       [-1,  2, -1, -1, -1,  2]])
```