Statistics, Machine Learning, Data Science, Financial Planning, Python.
= np.array(group1 + group2) labels = ['Group1'] * len(group1) + ['Group2'] * len(group2) # Create a DataFrame for the data df = pd.DataFrame({'data': data, 'group': labels}) df.head() # Perform one-way ANOVA model = ols('data ~ C(group)', data=df).fit() anova_table = sm.stats.anova_lm(model) #