Oh okay, I understand now. What criteria are you thinking of for the weights? What you used earlier isn’t even working. I wrote this tiny piece of code to prove it:
import random
import numpy
weight = 1
l = []
ans = []
weights = []
myDict = {}
for i in range(100):
myDict[i] = 0
l.append(i)
for x in range(len(l)):
weight = weight * 0.5
weights.append(weight)
for _ in range(1000):
for x in range(10):
b = numpy.random.choice(l, 1, weights)
myDict[b[0]] += 1
ans.append(b)
print(myDict)
# {0: 101, 1: 88, 2: 96, 3: 98, 4: 102, 5: 103, 6: 100, 7: 80, 8: 89, 9: 91, 10: 118, 11: 95, 12: 99, 13: 123, 14: 88, 15: 98, 16: 101, 17: 100, 18: 90, 19: 121, 20: 104, 21: 102, 22: 109, 23: 107, 24: 90, 25: 102, 26: 97, 27: 78, 28: 108, 29: 95, 30: 98, 31: 88, 32: 94, 33: 91, 34: 105, 35: 92, 36: 95, 37: 89, 38: 105, 39: 107, 40: 117, 41: 100, 42: 87, 43: 102, 44: 100, 45: 83, 46: 105, 47: 96, 48: 101, 49: 102, 50: 114, 51: 106, 52: 103, 53: 96, 54: 100, 55: 115, 56: 108, 57: 106, 58: 96, 59: 109, 60: 92, 61: 113, 62: 115, 63: 100, 64: 107, 65: 85, 66: 96, 67: 95, 68: 103, 69: 103, 70: 123, 71: 116, 72: 105, 73: 102, 74: 85, 75: 99, 76: 104, 77: 75, 78: 121, 79: 117, 80: 87, 81: 96, 82: 94, 83: 76, 84: 111, 85: 98, 86: 103, 87: 89, 88: 91, 89: 106, 90: 99, 91: 85, 92: 98, 93: 106, 94: 107, 95: 98, 96: 103, 97: 101, 98: 102, 99: 111}
# this means that out of 10'000 theoretically non-random draws,
# each number seems to have been chosen about 100 times out of 10'000, or 1/100.
# considering there are 100 numbers in total,
# there is no difference between this and a simple random.randint(0, 100)