# 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 данные различаются между собой в Генеральной совокупонсти"