I need to generate a large number of random poker card decks. Speed is important so everything has to be in numpy matrix form.
I understand I can generate two cards
A another simple approach, slightly slower than @Holt best solution.
def vectorized_app(N): u=np.random.randint(0,12*4,(2*N*103//100)).reshape(-1,2) # 3% more tries. w=np.not_equal(*u.T) #selecting valid output, Two differents cards. return u[w][:N]