We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cfb6e08 + ca54247 commit d57b17bCopy full SHA for d57b17b
Week03/weighted_besir_secilmis.py
@@ -0,0 +1,9 @@
1
+import random
2
+
3
+def weighted_srs(data, n, weights, with_replacement = False):
4
5
+ if with_replacement == True or weights != None:
6
+ sample = random.choices(data, k = n, weights = weights)
7
+ else:
8
+ sample = random.sample(data, n)
9
+ return sample
0 commit comments