We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 129e956 commit a616e35Copy full SHA for a616e35
Week02/weighted_semi_kazar.py
@@ -1,8 +1,9 @@
1
import random
2
+
3
def weighted_srs(data, n, weights, with_replacement = False):
4
if with_replacement != True or weights is None:
5
sample = random.sample(data, n)
6
else:
7
sample = random.choices(data, weights=weights, k=n)
8
- return sample
9
+ return sample
0 commit comments