diff --git a/practica/math/README.md b/practica/math/README.md index 72dcf1a..c4bd724 100644 --- a/practica/math/README.md +++ b/practica/math/README.md @@ -1,3 +1,3 @@ # Math Programms -[Overmaymant.py](overmaymant.py) - calculate loan overpaymant. \ No newline at end of file +nothing yet \ No newline at end of file diff --git a/practica/math/ord_tasks/README.me b/practica/math/ord_tasks/README.md similarity index 100% rename from practica/math/ord_tasks/README.me rename to practica/math/ord_tasks/README.md diff --git a/practica/math/statistic/README.md b/practica/math/statistic/README.md new file mode 100644 index 0000000..e79c7b9 --- /dev/null +++ b/practica/math/statistic/README.md @@ -0,0 +1,11 @@ +### Math|stat tasks +*** + Here you can find statistic tasks, which can be usefull in econometric calculations + +# Variance + + - [average value](average_value.py) - + - [Greatest common divisor](Greatest_common_divisor.py) - + + +# Statistic tasks diff --git a/practica/math/statistic/README.me b/practica/math/statistic/README.me deleted file mode 100644 index e69de29..0000000 diff --git a/practica/stepik/sketches/sketches.py b/practica/stepik/sketches/sketches.py index 2fe60c5..5135f5b 100644 --- a/practica/stepik/sketches/sketches.py +++ b/practica/stepik/sketches/sketches.py @@ -34,5 +34,3 @@ # print(i * n, end="\t") # print() - - \ No newline at end of file diff --git a/practica/stepik/tasks.py b/practica/stepik/tasks.py index 8aef1dc..e69de29 100644 --- a/practica/stepik/tasks.py +++ b/practica/stepik/tasks.py @@ -1,127 +0,0 @@ - -a = input().split() -len_a = len(a) - 1 -for index, number in enumerate(a): - if len_a == 0: - print (number) - else: - if index == 0: - S = int(a[-1]) + int(a[1]) - b = str(S) - elif index != 0 and index != int(len_a) : - n_index_0 = int(int(a.index(number)) + 1) - n_index_2 = int(int(a.index(number)) - 1) - n_0 = a[n_index_0] - N_2 = a[n_index_2] - S1 = int(n_0) + int(N_2) - b += " " + str(S1) - elif index == int(len_a): - S2 = int(a[0]) + int(a[-2]) - b += " " + str(S2) - print (b) -x = [int(m) for m in str(b)] -print (x) в список -print (" ".join(b)) - -# initial_list = input().split() -# sum_list = [] -# left_index = -1 -# right_index = -len(initial_list) + 1 -# middle_index = 0 -# while middle_index < len(initial_list): -# sum_list.append(initial_list[left_index] + initial_list[right_index]) -# left_index += 1 -# right_index += 1 -# middle_index += 1 -# print(sum_list) - - -# a = [int(item) for item in input().split()] -# a2 = [] -# for i in range(len(a)): -# if len(a) == 1: -# print(a[0]) -# break -# else: -# if i == 0: -# a2.append(a[-1] + a[i + 1]) -# elif i > 0 and i != len(a) - 1: -# a2.append(a[i - 1] + a[i + 1]) -# else: -# a2.append(a[i - 1] + a[0]) -# if a2 != 0: -# for i in a2: -# print(i, end=' ') - -# a = input().split() -# a_sorted= a.sort() -# int=0 -# for i, item in enumerate(a): -# if len(a) == 1: -# None -# else: -# # if a [i] == a [i+1]: -# n = - -# a = input().split() -# a2 = [] -# for item in a: -# c = a.count(item) -# if c > 1: -# a2.append(item) -# if c == 1: -# None -# def del_dubl(a2): -# seen = set() -# seen_add = seen.add -# return [x for x in a2 if not (x in seen or seen_add(x))] -# for i in del_dubl(a2): -# print(i, end=' ') - -# удаление дубликатов -# a = input().split() -# def del_dubl(a): -# seen = set() -# seen_add = seen.add -# return [x for x in a if not (x in seen or seen_add(x))] -# print (del_dubl(a)) - -# n =3 -# a = [[0]*n]*n -# a[0][0]= 5 -# print (a) - - -# from scipy.stats import f -# data = pd.DataFrame({1:[3,1,2],2:[5,3,4],3:[7,6,5]}) # Here 3 groups and we are going to compare them -# def odno_disp(data): -# first_group = [i for i in data[1]] # Выделяем группы для операции над данными -# second_group = [i for i in data[2]] -# third_group = [i for i in data[3]] -# number_of_groups = len([first_group,second_group,third_group]) - -# all_groups = first_group+second_group+third_group # Все группы тут -# mean_of_all_groups = np.mean(all_groups) # среднее значение всей группы - -# sum_of_squared_total = sum([(i-mean_of_all_groups)**2 for i in all_groups]) # Обьщая изменчивость наших данных, здесь мы расчитали сумму всех квадратов отклонение от среднего -# df_of_sst = len(all_groups) - 1 # Число степеней свободы в SST - -# ssw1 = sum([(i-np.mean(first_group))**2 for i in first_group]) # для расчета суммы квадратов -# ssw2 = sum([(i-np.mean(second_group))**2 for i in second_group]) # расчитаем сумму кв всех групп -# ssw3 = sum([(i-np.mean(third_group))**2 for i in third_group]) -# sum_of_squared_within = ssw1+ssw2+ssw3 # сумма квадратов внутри групповая -# df_of_ssw = len(all_groups) - number_of_groups # Число степеней свободы во внутри групповой - -# # Теперь узнаем на сколько наши групповые отклоняются от общегрупповых средних -# for_minus_from_each_group = [first_group, second_group, third_group] # для минуса из каждых групп -# sum_of_squared_between = sum([number_of_groups*(np.mean(i)-mean_of_all_groups)**2 for i in for_minus_from_each_group]) -# df_of_ssb = number_of_groups - 1 - -# F = (sum_of_squared_between / df_of_ssb) / (sum_of_squared_within / df_of_ssw) -# P_value = f.sf(F, df_of_ssb, df_of_ssw) -# if P_value >= 0.05: -# return f"Мы не отклоняем нулевую гипотезу так как P_value = {P_value}" -# else: -# return f"Мы отклоняем нулевую гипотезу то есть P value = {P_value}, H1 верна то есть минимум 2 данные различаются между собой в Генеральной совокупонсти" -# p = odno_disp(data) -#dd \ No newline at end of file