How to judge whether the data conforms to the normal distribution

Just remember it when you use it = = Too much time, and slowly forget it.

1. QQ map

Let's take a look at the standard normal distribution chart:
Insert picture description here

stats.probplot(df1['3#3temp'], dist="norm", plot=plt)
plt.show()

result:
Insert picture description here

2. Histogram

plt.hist(df1['3#3temp'])

Insert picture description here

3. Shapiro test

stats.shapiro(df1[str(a)])

The return value can be seen by the p value, and the smaller the value, the compliance.

Finally, let me talk about == What if the data does not conform to the normal distribution?
If the skewness is not serious, the data can be converted by taking the square root. If the skewness is severe, logarithmic transformation can be performed on the data.

Guess you like

Origin blog.csdn.net/weixin_45743162/article/details/113520649