result = np.zeros(len(colors), dtype=np.int)
for i in range(len(colors) - 1):
    if m < 1:
        break
result[i] = np.random.hypergeometric(colors[i], remaining[i + 1], m)
m -= result[i]
result[-1] = m
return result
Numpy рисунок из урны