Element-comparison NumPy matrix
Why are you using matrix rather than array? I recommend sticking with array

As for a better way:

seq = numpy.array([0, 1, 2, 3])
numpy.clip(seq[:,None] - seq, -1, 1)



seq[:, None], moves the numbers into the second dimension of the array
seq[:, None] - seq broadcasts the numbers against each other, and subtracts them.
numpy.clip converts lower/higher values into 1 and -1