Your desired result does not make sense, but here is something that does what I assume you really want. You can trim the 0th row and column by doing m = m[1:,1:]
>>> d = {0: [2, 5.0], 1: [6, 7.0], 2: [6, 8.0], 3: [5, 6.0], 4: [1, 5.0], 5: [3, 4.0], 6: [4, 5.0]} >>> dims = [1 + int(x) for x in map(max, zip(*d.values()))] >>> m = numpy.zeros(dims, dtype=int) >>> for v in map(tuple, d.values()): m[v] = 1 >>> m array([[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1]])