Possible duplicate:
How do I randomly select an item from a list using Python?
I have two arrays pool_list_X, pool_list_Y. Both have a numpy array as an item in the list. So basically
pool_list_x[0] = [1 2 3 4]
and each pool_list_x element has a corresponding element in pool_list_y
which is to say, that pool_list_x[i] corresponds to pool_list_y[i]
Now. if I need to randomly select 10 items from list_x (and therefore the corresponding items in list_y). How can I do it. I can come up with a very naive way ... to randomly generate numbers. etc., but itβs not very effective .. what is the pythonic way to do this. Thanks
source share