Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
53 lines (34 loc) · 1.2 KB

File metadata and controls

53 lines (34 loc) · 1.2 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 8 14:03:57 2020
@author: sadrachpierre
"""
import random
bmi_list = [29, 18, 20, 22, 19, 25, 30, 28,22, 21, 18, 19, 20, 20, 22, 23]
print("First random choice:", random.choice(bmi_list))
print("Second random choice:", random.choice(bmi_list))
print("Third random choice:", random.choice(bmi_list))
print("Random sample, N=5 :", random.sample(bmi_list, 5))
print("Random sample, N=10:", random.sample(bmi_list, 10))
print("BMI list: ", bmi_list)
random.shuffle(bmi_list)
print("Shuffled BMI list: ", bmi_list)
print("Random Integer: ", random.randint(1,5))
random_ints_list = []
for i in range(1,50):
n = random.randint(1,5)
random_ints_list.append(n)
print("My random integer list: ", random_ints_list)
print("Random Float: ", random.random())
random_float_list = []
for i in range(1,10):
n = random.random()*500
if n>=100.0:
random_float_list.append(n)
print("My random float list: ", random_float_list)
import numpy as np
uniform_list = np.random.uniform(-10,1,50)
print("Uniformly Distributed Numbers: ", uniform_list)
normal_list = np.random.uniform(-50,0,50)
print("Normally Distributed Numbers: ", normal_list)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.