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 40f7f13 + 4798717 commit 384a2fcCopy full SHA for 384a2fc
Week03/weighted_birhat_tas.py
@@ -0,0 +1,9 @@
1
+import random
2
+
3
+def weighted_srs(data,n,weights,with_replacement = False):
4
+ if with_replacement == True or weights != None:
5
+ sample = random.choices(data,k=n,weights = weights)
6
+ else:
7
+ sample = random.sample(data,n)
8
+ return sample
9
0 commit comments