I have this code to check the Kolmogorov-Smirnov test. But it gives the wrong result. What is the problem?
import pandas
import random
import matplotlib
import numpy
import matplotlib.pyplot as plt
datas = [0.3877, 0.3878, 0.3877, 0.3877, 0.3877, 0.3879, 0.3899, 0.3892, 0.3881, 0.3873, 0.3886, 0.3875, 0.3876, 0.3893, 0.3888, 0.3886, 0.388, 0.3886, 0.387, 0.3872, 0.388, 0.3877, 0.3867, 0.3898, 0.3878, 0.3886, 0.3883, 0.388, 0.3877, 0.3886, 0.3877, 0.3879, 0.3883, 0.3878, 0.3882, 0.3878, 0.3883, 0.3867, 0.3881, 0.3883, 0.3882, 0.3884, 0.3876, 0.3878, 0.3886, 0.3885, 0.3865, 0.3874, 0.3878, 0.388]
from scipy.stats import kstest
print(kstest(datas, 'norm'))
Must be
KstestResult(statistic=0.11781653619879678, pvalue=0.45678095532064167
According to my data, this is coming out:
KstestResult(statistic=0.6504367986973135, pvalue=3.3658717487529006e-21