sample = xy.take(np.random.choice(xy.shape[0], 100, replace=False), axis=0)
How to generate random pairs of numbers in Python, including pairs with one entry being the same and excluding pairs with both entries being the same?