diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b634d85 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.pdf filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6f66c74 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.zip \ No newline at end of file diff --git a/zad1/main.py b/zad1/main.py index ad366ae..df313af 100644 --- a/zad1/main.py +++ b/zad1/main.py @@ -39,21 +39,19 @@ def sample_standard_deviation(lst, lst_mean): def q1(lst, lst_median): is_even = len(lst) % 2 == 0 - idx = len(lst)//2 if is_even else len(lst)//2+1 + idx = len(lst)//2 sorted_list = lst[:idx] - if is_even: + if not is_even: sorted_list.append(lst_median) - return median(sorted_list) -# + def q3(lst, lst_median): is_even = len(lst) % 2 == 0 - idx = len(lst)//2+1 if is_even else len(lst)//2 + idx = len(lst)//2 if is_even else len(lst)//2+1 sorted_list = lst[idx:] - if is_even: + if not is_even: sorted_list.insert(0, lst_median) - return median(sorted_list) @@ -186,7 +184,6 @@ def main(): petal_width_list.append(float(petal_width)) species_dict[species] += 1 - sepal_length_list.sort() sepal_width_list.sort() petal_length_list.sort() diff --git a/zad1/ml_195642_zad1.pdf b/zad1/ml_195642_zad1.pdf new file mode 100644 index 0000000..50bfc3b --- /dev/null +++ b/zad1/ml_195642_zad1.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8938c77c3c7c2be04320e6f6e319af59cc0f01c0f8b9ef4f25304537291317bf +size 134137