JavaScript
- 14 ответов
- 0 вопросов
12
Вклад в тег
users = {
'Вася' : {
'job': 'Слесарь',
'phone' : 123345
},
'Петя' : {
'job': 'Слесарь',
'phone' : 789901
}
}
jobs = {
'Вася' : { 'job': 'Плотник' },
'Петя' : { 'job': 'Столяр' }
}
Object.assign(obj.users, users)
Object.assign(obj.users, jobs)
Object.assign(obj.users, users, jobs)
obj.users = object_assign(obj.users, users, jobs)
your_data_list = [...]
probabilities_list=[60, 85, 97, 100]
rnd = random.uniform(1, 100)
idx = -1
idx_found = False
while idx < len(probabilities_list) and not idx_found:
idx += 1
idx_found = rnd <= probabilities_list[idx]
your_random = your_data_list[idx]
idx = bisect.bisect_right(probabilities_list, rnd)
numpy.random.choice(your_data_list, size=N, p=prb_list)