diff --git a/Week01/info_asimerdem_uysal.py b/Week01/info_asimerdem_uysal.py new file mode 100644 index 00000000..5731d80f --- /dev/null +++ b/Week01/info_asimerdem_uysal.py @@ -0,0 +1,2 @@ +student_id = "230315026" +full_name = "Asım Erdem Uysal" \ No newline at end of file diff --git a/Week02/weighted_asimerdem_uysal.py b/Week02/weighted_asimerdem_uysal.py new file mode 100644 index 00000000..6ced0192 --- /dev/null +++ b/Week02/weighted_asimerdem_uysal.py @@ -0,0 +1,6 @@ +import random + +def weighted_srs(data, n, weights, with_replacement=False): + if with_replacement: return random.choices(data, weights=weights, k=n) # sample with replacement + if not weights: return random.sample(data, n) # simple random sample without weights + return random.sample(data, n, counts=weights) # sample without replacement using weights as counts diff --git a/pull_request_template.md b/pull_request_template.md index 252a7f4b..c9eb6baf 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -1,10 +1,10 @@ ## Describe your changes ## Checklist -- [ ] I have read the [CONTRIBUTING] -- [ ] I have performed a self-review of my own code -- [ ] I have run the code locally and it works as expected -- [ ] I have commented my code, particularly in hard-to-understand areas +- [X] I have read the [CONTRIBUTING] +- [X] I have performed a self-review of my own code +- [X] I have run the code locally and it works as expected +- [X] I have commented my code, particularly in hard-to-understand areas ## Screenshots (if appropriate)