I have a numpy array
a = numpy.array([1,2,3,0])
I would like to do something like
a == numpy.array([0,1,2,3])
and get
[[False, True, False, False],
[False, False, True, False],
[False, False, False, True ],
[True, False, False, False]]
In other words, I want the ith column to show whether each element of a is equal to i. This feels like the kind of thing that numpy might make easy. Any ideas?