What code can I use if I have ten numbers and I want to produce 1000 different randomly shuffled orders of the the ten numbers
<p>I can use this to find all of the possible options, however, I want a random sample of 1000 from this set:</p>

<pre><code>items = range(1,11)
//from itertools import permutations
//for p in permutations(items):
print(p)
</code></pre>

<p>Here is a suggested solution. Based on your requirements, the list of 10 numbers are already chosen, and you just want to have a list that will have those 10 numbers shuffled in 1000 unique ways. So below, I have a list of 10 numbers. The random.sample(num_list,10), will select those 10 numbers at random, and create a new list. Since the list has only 10 numbers, it selects all 10 in random order and creates the new list. It checks the overall answer list to see if that order had been selected before. If it hasn't, it adds it to the list. It does this until 1000 unique orders have been found:</p>

<pre><code>import random
num_list = [6, 9, 1000, 53, 321, 8, -5, 714, 0, 2120]
answer_list = []
while len(answer_list) != 1000:
    new_sample = random.sample(num_list, 10)
    if new_sample not in answer_list:
        answer_list.append(new_sample)
</code></pre>

<p>So after running the script here are the last 5 items on the list and the first 5 items on the list:</p>

<pre><code>==== RESTART: C:/Users/Joe/Desktop/scripts/Stack_overflow/ransom.py ====
&gt;&gt;&gt; answer_list[-5:]
[[0, 9, 8, 53, 321, 1000, -5, 6, 2120, 714],
 [714, 0, 2120, 6, -5, 53, 8, 321, 9, 1000],
 [6, -5, 53, 321, 0, 1000, 2120, 8, 9, 714],
 [321, 53, 9, 8, 2120, 714, 0, 1000, -5, 6],
 [1000, 53, 2120, 6, 8, 9, -5, 714, 321, 0]]
&gt;&gt;&gt; answer_list[:5]
[[321, 9, 714, -5, 53, 6, 1000, 8, 0, 2120],
 [0, 6, 2120, -5, 714, 9, 1000, 8, 53, 321],
 [1000, 8, 9, 6, 53, 321, 2120, 714, 0, -5],
 [9, 0, 321, 6, 714, 53, 1000, 2120, -5, 8],
 [6, 1000, 321, 0, -5, 2120, 8, 714, 9, 53]]
&gt;&gt;&gt; 
</code></pre>

python random permutation shuffle sample