From 960dfbf21a73a406dca05febf719ac8632683a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6khan=20Koray=20B=C3=BClb=C3=BCl?= <240315006@ogr.cbu.edu.tr> Date: Sat, 8 Mar 2025 14:44:09 +0300 Subject: [PATCH 1/3] Create weighted_gokhanKoray_bulbul.py --- Week03/weighted_gokhanKoray_bulbul.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Week03/weighted_gokhanKoray_bulbul.py diff --git a/Week03/weighted_gokhanKoray_bulbul.py b/Week03/weighted_gokhanKoray_bulbul.py new file mode 100644 index 0000000..43d24ed --- /dev/null +++ b/Week03/weighted_gokhanKoray_bulbul.py @@ -0,0 +1,9 @@ +import random + +def weighted_srs(data, n, weights, with_replacement): + Sample = [] + if (with_replacement): + Sample = random.choices(data, weights, k=n) + else: + Sample = random.sample(data, n, counts=weights) + return Sample From f20e388078279fd99848d3762ff48b12b053e77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6khan=20Koray=20B=C3=BClb=C3=BCl?= <240315006@ogr.cbu.edu.tr> Date: Wed, 12 Mar 2025 07:56:34 +0300 Subject: [PATCH 2/3] Rename weighted_gokhanKoray_bulbul.py to weighted_gokhankoray_bulbul.py --- ...ghted_gokhanKoray_bulbul.py => weighted_gokhankoray_bulbul.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Week03/{weighted_gokhanKoray_bulbul.py => weighted_gokhankoray_bulbul.py} (100%) diff --git a/Week03/weighted_gokhanKoray_bulbul.py b/Week03/weighted_gokhankoray_bulbul.py similarity index 100% rename from Week03/weighted_gokhanKoray_bulbul.py rename to Week03/weighted_gokhankoray_bulbul.py From 1b2e3ccb4cf91a79a30d1b86f43accba66c41eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6khan=20Koray=20B=C3=BClb=C3=BCl?= <240315006@ogr.cbu.edu.tr> Date: Mon, 24 Mar 2025 07:23:06 +0300 Subject: [PATCH 3/3] Update weighted_gokhankoray_bulbul.py --- Week03/weighted_gokhankoray_bulbul.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Week03/weighted_gokhankoray_bulbul.py b/Week03/weighted_gokhankoray_bulbul.py index 43d24ed..566072d 100644 --- a/Week03/weighted_gokhankoray_bulbul.py +++ b/Week03/weighted_gokhankoray_bulbul.py @@ -1,9 +1,9 @@ import random def weighted_srs(data, n, weights, with_replacement): - Sample = [] + sample = [] if (with_replacement): - Sample = random.choices(data, weights, k=n) + sample = random.choices(data, weights, k=n) else: - Sample = random.sample(data, n, counts=weights) - return Sample + sample = random.sample(data, n, counts=weights) + return sample