diff --git a/Week01/info_recepgoktug_avci.py b/Week01/info_recepgoktug_avci.py new file mode 100644 index 00000000..39097443 --- /dev/null +++ b/Week01/info_recepgoktug_avci.py @@ -0,0 +1,3 @@ + +student_id = "220316021" +full_name = "Recep Göktuğ Avcı" diff --git a/Week02/weighted_recepgoktug_avci.py b/Week02/weighted_recepgoktug_avci.py new file mode 100644 index 00000000..5d89c981 --- /dev/null +++ b/Week02/weighted_recepgoktug_avci.py @@ -0,0 +1,6 @@ +import random +def weighted_srs(data, n, weights, with_replacement = False): + if with_replacement: + return random.choices(data, k = n, weights = weights) + else: + return random.sample(data, n, counts = weights)