Skip to content

Commit a616e35

Browse files
authored
Add import statement for random module
1 parent 129e956 commit a616e35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Week02/weighted_semi_kazar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import random
2+
23
def weighted_srs(data, n, weights, with_replacement = False):
34
if with_replacement != True or weights is None:
45
sample = random.sample(data, n)
56
else:
67
sample = random.choices(data, weights=weights, k=n)
78

8-
return sample
9+
return sample

0 commit comments

Comments
 (0)