A = numpy.array([[5.0, 5.0, 5.0], [8.0, 9.0, 9.0]])
B = numpy.array([[1.0, 1.0, 2.0], [3.0, 2.0, 1.0]])
uniqB, inverse = numpy.unique(B, return_inverse=True)
Finding items in one array based upon a second array