We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 35f892f + ce8c3df commit 8112eb5Copy full SHA for 8112eb5
Week02/weighted_ebru_koksal.py
@@ -0,0 +1,9 @@
1
+import random
2
+
3
+def weighted_srs(data, n, weights, with_replacement=False):
4
5
+ if weights: return random.choices(data, weights=weights, k=n)
6
7
+ if with_replacement:return random.choices(data,k=n)
8
9
+ return random.sample(data,k=n)
0 commit comments