num_runs = 100000
p_values = []
for i in range(1, num_runs+1):
ornek1 = 2*np.random.normal(0,1,5)
ornek2 = 3*np.random.normal(0,2,5)
ornek3 = 10*np.random.normal(0,5,5)
levene = sp.levene(ornek1,ornek2,ornek3, center = 'mean')
if levene[1] < 0.05:
ornek1 = np.log10(ornek1)
ornek2 = np.log10(ornek2)
ornek3 = np.log10(ornek3)
else:
continue
anova = sp.f_oneway(ornek1,ornek2,ornek3)
p_values.append(anova[1])
hesap = sum(map(lambda x: x<0.05, p_values))
print(hesap/100000)
RuntimeWarning: invalid value encountered in log10
ornek1 = np.log10(ornek1)
How can I fix this problem ? I can't find anything. I want to transform my samples after levene test but ı can't. Is it about to numpy ?