Zad1 - done
This commit is contained in:
		
							
								
								
									
										13
									
								
								zad1/main.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								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() | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								zad1/ml_195642_zad1.pdf
									
									LFS
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								zad1/ml_195642_zad1.pdf
									
									LFS
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user