Answers for "generate random number according to distribution python"

0

python random distribution

#random distributer of elements in List
import random

List = [9,9,9,9,8,8,7,7,6,6,6,"G"] #my grades 
len_ = len(List)
Rand_List = []

for l in range(len_):
    rand_ = random.randint(0,len(List)-1)
    Rand_List.append(List[rand_])
    del List[rand_]

print(Rand_List)#if my grades are displaced in random order
Posted by: Guest on April-13-2022
1

how to generate random normal number in python

from scipy.stats import norm
data = norm.rvs(loc=52, scale=4.5, size=100)
Posted by: Guest on May-11-2021

Code answers related to "generate random number according to distribution python"

Python Answers by Framework

Browse Popular Code Answers by Language