{"id":1164317,"date":"2025-01-15T15:05:43","date_gmt":"2025-01-15T07:05:43","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1164317.html"},"modified":"2025-01-15T15:05:46","modified_gmt":"2025-01-15T07:05:46","slug":"%e5%a6%82%e4%bd%95%e9%aa%8c%e8%af%81%e6%95%b0%e6%8d%ae%e6%ad%a3%e6%80%81%e5%88%86%e5%b8%83python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1164317.html","title":{"rendered":"\u5982\u4f55\u9a8c\u8bc1\u6570\u636e\u6b63\u6001\u5206\u5e03python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25204927\/4c0b635b-c1cc-41fc-ad34-3e0454376231.webp\" alt=\"\u5982\u4f55\u9a8c\u8bc1\u6570\u636e\u6b63\u6001\u5206\u5e03python\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u9a8c\u8bc1\u6570\u636e\u6b63\u6001\u5206\u5e03python<\/strong><\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528\u76f4\u65b9\u56fe\u548cQQ\u56fe\u3001Shapiro-Wilk\u68c0\u9a8c\u3001Kolmogorov-Smirnov\u68c0\u9a8c<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u6570\u636e\u5206\u6790\u4e2d\uff0c\u9a8c\u8bc1\u6570\u636e\u662f\u5426\u670d\u4ece\u6b63\u6001\u5206\u5e03\u662f\u975e\u5e38\u91cd\u8981\u7684\u4e00\u6b65\u3002\u4f7f\u7528\u76f4\u65b9\u56fe\u548cQQ\u56fe\u53ef\u4ee5\u76f4\u89c2\u5730\u89c2\u5bdf\u6570\u636e\u5206\u5e03\u60c5\u51b5\uff1bShapiro-Wilk\u68c0\u9a8c\u548cKolmogorov-Smirnov\u68c0\u9a8c\u662f\u4e24\u79cd\u5e38\u7528\u7684\u7edf\u8ba1\u65b9\u6cd5\u6765\u9a8c\u8bc1\u6570\u636e\u6b63\u6001\u6027\u3002<strong>\u8be6\u7ec6\u4ecb\u7ecdShapiro-Wilk\u68c0\u9a8c<\/strong>\uff1aShapiro-Wilk\u68c0\u9a8c\u662f\u4e00\u79cd\u7528\u4e8e\u68c0\u9a8c\u6837\u672c\u662f\u5426\u6765\u81ea\u6b63\u6001\u5206\u5e03\u7684\u7edf\u8ba1\u65b9\u6cd5\uff0c\u5b83\u7684\u5047\u8bbe\u68c0\u9a8c\u6b65\u9aa4\u4e3a\uff1a\u96f6\u5047\u8bbe\uff08H0\uff09\u5047\u8bbe\u6570\u636e\u670d\u4ece\u6b63\u6001\u5206\u5e03\uff0c\u5907\u62e9\u5047\u8bbe\uff08H1\uff09\u5047\u8bbe\u6570\u636e\u4e0d\u670d\u4ece\u6b63\u6001\u5206\u5e03\u3002\u5f53p\u503c\u5927\u4e8e\u663e\u8457\u6027\u6c34\u5e73\uff08\u901a\u5e38\u4e3a0.05\uff09\u65f6\uff0c\u63a5\u53d7\u96f6\u5047\u8bbe\uff0c\u8ba4\u4e3a\u6570\u636e\u670d\u4ece\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u76f4\u65b9\u56fe\u548cQQ\u56fe<\/h3>\n<\/p>\n<p><p>\u76f4\u65b9\u56fe\u548cQQ\u56fe\u662f\u4e24\u79cd\u76f4\u89c2\u7684\u53ef\u89c6\u5316\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u521d\u6b65\u5224\u65ad\u6570\u636e\u662f\u5426\u670d\u4ece\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><h4>1. \u76f4\u65b9\u56fe<\/h4>\n<\/p>\n<p><p>\u76f4\u65b9\u56fe\u662f\u4e00\u79cd\u67f1\u72b6\u56fe\uff0c\u901a\u8fc7\u5c55\u793a\u6570\u636e\u7684\u9891\u7387\u5206\u5e03\uff0c\u5e2e\u52a9\u6211\u4eec\u89c2\u5bdf\u6570\u636e\u7684\u5206\u5e03\u5f62\u6001\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u751f\u6210\u6837\u672c\u6570\u636e<\/strong><\/h2>\n<p>data = np.random.normal(0, 1, 1000)<\/p>\n<h2><strong>\u7ed8\u5236\u76f4\u65b9\u56fe<\/strong><\/h2>\n<p>plt.hist(data, bins=30, density=True, alpha=0.6, color=&#39;g&#39;)<\/p>\n<h2><strong>\u7ed8\u5236\u6b63\u6001\u5206\u5e03\u66f2\u7ebf<\/strong><\/h2>\n<p>mu, std = np.mean(data), np.std(data)<\/p>\n<p>xmin, xmax = plt.xlim()<\/p>\n<p>x = np.linspace(xmin, xmax, 100)<\/p>\n<p>p = np.exp(-0.5*((x - mu)\/std)2) \/ (std * np.sqrt(2 * np.pi))<\/p>\n<p>plt.plot(x, p, &#39;k&#39;, linewidth=2)<\/p>\n<p>plt.title(&#39;Histogram&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. QQ\u56fe<\/h4>\n<\/p>\n<p><p>QQ\u56fe\uff08Quantile-Quantile Plot\uff09\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5224\u65ad\u6570\u636e\u5206\u5e03\u662f\u5426\u4e0e\u6b63\u6001\u5206\u5e03\u4e00\u81f4\u3002QQ\u56fe\u4e2d\u7684\u70b9\u5982\u679c\u63a5\u8fd1\u4e00\u6761\u76f4\u7ebf\uff0c\u8bf4\u660e\u6570\u636e\u5927\u81f4\u670d\u4ece\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import scipy.stats as stats<\/p>\n<h2><strong>\u7ed8\u5236QQ\u56fe<\/strong><\/h2>\n<p>stats.probplot(data, dist=&quot;norm&quot;, plot=plt)<\/p>\n<p>plt.title(&#39;QQ Plot&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001Shapiro-Wilk\u68c0\u9a8c<\/h3>\n<\/p>\n<p><p>Shapiro-Wilk\u68c0\u9a8c\u662f\u4e00\u79cd\u5e38\u7528\u7684\u7edf\u8ba1\u68c0\u9a8c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5b9a\u91cf\u5730\u5224\u65ad\u6570\u636e\u662f\u5426\u670d\u4ece\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy.stats import shapiro<\/p>\n<h2><strong>\u8fdb\u884cShapiro-Wilk\u68c0\u9a8c<\/strong><\/h2>\n<p>stat, p = shapiro(data)<\/p>\n<p>print(&#39;Shapiro-Wilk Test: Statistics=%.3f, p=%.3f&#39; % (stat, p))<\/p>\n<h2><strong>\u5224\u65adp\u503c<\/strong><\/h2>\n<p>alpha = 0.05<\/p>\n<p>if p &gt; alpha:<\/p>\n<p>    print(&#39;Sample looks Gaussian (f<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>l to reject H0)&#39;)<\/p>\n<p>else:<\/p>\n<p>    print(&#39;Sample does not look Gaussian (reject H0)&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001Kolmogorov-Smirnov\u68c0\u9a8c<\/h3>\n<\/p>\n<p><p>Kolmogorov-Smirnov\u68c0\u9a8c\u662f\u4e00\u79cd\u975e\u53c2\u6570\u68c0\u9a8c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7528\u4e8e\u68c0\u9a8c\u5355\u4e2a\u6837\u672c\u4e0e\u7279\u5b9a\u5206\u5e03\uff08\u5982\u6b63\u6001\u5206\u5e03\uff09\u7684\u62df\u5408\u4f18\u5ea6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy.stats import kstest<\/p>\n<h2><strong>\u8fdb\u884cKolmogorov-Smirnov\u68c0\u9a8c<\/strong><\/h2>\n<p>stat, p = kstest(data, &#39;norm&#39;, args=(np.mean(data), np.std(data)))<\/p>\n<p>print(&#39;Kolmogorov-Smirnov Test: Statistics=%.3f, p=%.3f&#39; % (stat, p))<\/p>\n<h2><strong>\u5224\u65adp\u503c<\/strong><\/h2>\n<p>alpha = 0.05<\/p>\n<p>if p &gt; alpha:<\/p>\n<p>    print(&#39;Sample looks Gaussian (fail to reject H0)&#39;)<\/p>\n<p>else:<\/p>\n<p>    print(&#39;Sample does not look Gaussian (reject H0)&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001Anderson-Darling\u68c0\u9a8c<\/h3>\n<\/p>\n<p><p>Anderson-Darling\u68c0\u9a8c\u662f\u4e00\u79cd\u6539\u8fdb\u7684Kolmogorov-Smirnov\u68c0\u9a8c\uff0c\u5b83\u5bf9\u5c3e\u90e8\u7684\u504f\u5dee\u66f4\u52a0\u654f\u611f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy.stats import anderson<\/p>\n<h2><strong>\u8fdb\u884cAnderson-Darling\u68c0\u9a8c<\/strong><\/h2>\n<p>result = anderson(data)<\/p>\n<p>print(&#39;Anderson-Darling Test: Statistic=%.3f&#39; % (result.statistic))<\/p>\n<h2><strong>\u5224\u65ad\u4e34\u754c\u503c<\/strong><\/h2>\n<p>for i in range(len(result.critical_values)):<\/p>\n<p>    sl, cv = result.significance_level[i], result.critical_values[i]<\/p>\n<p>    if result.statistic &lt; cv:<\/p>\n<p>        print(&#39;%.3f: %.3f, data looks normal (fail to reject H0)&#39; % (sl, cv))<\/p>\n<p>    else:<\/p>\n<p>        print(&#39;%.3f: %.3f, data does not look normal (reject H0)&#39; % (sl, cv))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001D\u2019Agostino\u2019s K-squared Test<\/h3>\n<\/p>\n<p><p>D\u2019Agostino\u2019s K-squared Test\u53ef\u4ee5\u68c0\u6d4b\u6570\u636e\u7684\u504f\u5ea6\u548c\u5cf0\u5ea6\u662f\u5426\u4e0e\u6b63\u6001\u5206\u5e03\u4e00\u81f4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy.stats import normaltest<\/p>\n<h2><strong>\u8fdb\u884cD\u2019Agostino\u2019s K-squared Test<\/strong><\/h2>\n<p>stat, p = normaltest(data)<\/p>\n<p>print(&#39;D\u2019Agostino\u2019s K-squared Test: Statistics=%.3f, p=%.3f&#39; % (stat, p))<\/p>\n<h2><strong>\u5224\u65adp\u503c<\/strong><\/h2>\n<p>alpha = 0.05<\/p>\n<p>if p &gt; alpha:<\/p>\n<p>    print(&#39;Sample looks Gaussian (fail to reject H0)&#39;)<\/p>\n<p>else:<\/p>\n<p>    print(&#39;Sample does not look Gaussian (reject H0)&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528\u5de5\u5177\u7bb1\uff08\u5982SciPy\u548cStatsmodels\uff09<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528SciPy\u548cStatsmodels\u5de5\u5177\u7bb1\u53ef\u4ee5\u66f4\u52a0\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u6b63\u6001\u5206\u5e03\u7684\u9a8c\u8bc1\u3002<\/p>\n<\/p>\n<p><h4>1. SciPy<\/h4>\n<\/p>\n<p><p>SciPy\u63d0\u4f9b\u4e86\u591a\u79cd\u7edf\u8ba1\u68c0\u9a8c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u6b63\u6001\u5206\u5e03\u7684\u9a8c\u8bc1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy.stats import shapiro, kstest, normaltest, anderson<\/p>\n<h2><strong>Shapiro-Wilk Test<\/strong><\/h2>\n<p>stat, p = shapiro(data)<\/p>\n<p>print(&#39;Shapiro-Wilk Test: Statistics=%.3f, p=%.3f&#39; % (stat, p))<\/p>\n<h2><strong>Kolmogorov-Smirnov Test<\/strong><\/h2>\n<p>stat, p = kstest(data, &#39;norm&#39;, args=(np.mean(data), np.std(data)))<\/p>\n<p>print(&#39;Kolmogorov-Smirnov Test: Statistics=%.3f, p=%.3f&#39; % (stat, p))<\/p>\n<h2><strong>D\u2019Agostino\u2019s K-squared Test<\/strong><\/h2>\n<p>stat, p = normaltest(data)<\/p>\n<p>print(&#39;D\u2019Agostino\u2019s K-squared Test: Statistics=%.3f, p=%.3f&#39; % (stat, p))<\/p>\n<h2><strong>Anderson-Darling Test<\/strong><\/h2>\n<p>result = anderson(data)<\/p>\n<p>print(&#39;Anderson-Darling Test: Statistic=%.3f&#39; % (result.statistic))<\/p>\n<p>for i in range(len(result.critical_values)):<\/p>\n<p>    sl, cv = result.significance_level[i], result.critical_values[i]<\/p>\n<p>    if result.statistic &lt; cv:<\/p>\n<p>        print(&#39;%.3f: %.3f, data looks normal (fail to reject H0)&#39; % (sl, cv))<\/p>\n<p>    else:<\/p>\n<p>        print(&#39;%.3f: %.3f, data does not look normal (reject H0)&#39; % (sl, cv))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. Statsmodels<\/h4>\n<\/p>\n<p><p>Statsmodels\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7edf\u8ba1\u5efa\u6a21\u5de5\u5177\u7bb1\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u5efa\u6a21\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import statsmodels.api as sm<\/p>\n<h2><strong>\u7ed8\u5236QQ\u56fe<\/strong><\/h2>\n<p>sm.qqplot(data, line=&#39;45&#39;)<\/p>\n<p>plt.title(&#39;QQ Plot&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u6570\u636e\u9884\u5904\u7406\u548c\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>\u6709\u65f6\u6570\u636e\u53ef\u80fd\u4e0d\u670d\u4ece\u6b63\u6001\u5206\u5e03\uff0c\u4f46\u901a\u8fc7\u9002\u5f53\u7684\u9884\u5904\u7406\u548c\u8f6c\u6362\uff0c\u53ef\u4ee5\u4f7f\u6570\u636e\u63a5\u8fd1\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><h4>1. \u6570\u636e\u6807\u51c6\u5316<\/h4>\n<\/p>\n<p><p>\u6570\u636e\u6807\u51c6\u5316\u53ef\u4ee5\u5c06\u6570\u636e\u8f6c\u6362\u4e3a\u5747\u503c\u4e3a0\u3001\u6807\u51c6\u5dee\u4e3a1\u7684\u6807\u51c6\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.preprocessing import StandardScaler<\/p>\n<p>scaler = StandardScaler()<\/p>\n<p>data_scaled = scaler.fit_transform(data.reshape(-1, 1)).flatten()<\/p>\n<h2><strong>\u7ed8\u5236QQ\u56fe<\/strong><\/h2>\n<p>sm.qqplot(data_scaled, line=&#39;45&#39;)<\/p>\n<p>plt.title(&#39;QQ Plot (Standardized Data)&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u6570\u636e\u5bf9\u6570\u53d8\u6362<\/h4>\n<\/p>\n<p><p>\u5bf9\u6570\u53d8\u6362\u53ef\u4ee5\u51cf\u5c0f\u6570\u636e\u7684\u504f\u5ea6\uff0c\u4f7f\u6570\u636e\u66f4\u52a0\u63a5\u8fd1\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">data_log = np.log(data - np.min(data) + 1)<\/p>\n<h2><strong>\u7ed8\u5236QQ\u56fe<\/strong><\/h2>\n<p>sm.qqplot(data_log, line=&#39;45&#39;)<\/p>\n<p>plt.title(&#39;QQ Plot (Log Transformed Data)&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. Box-Cox\u53d8\u6362<\/h4>\n<\/p>\n<p><p>Box-Cox\u53d8\u6362\u662f\u4e00\u79cd\u5e38\u7528\u7684\u6570\u636e\u53d8\u6362\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5c06\u975e\u6b63\u6001\u5206\u5e03\u7684\u6570\u636e\u8f6c\u6362\u4e3a\u63a5\u8fd1\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy.stats import boxcox<\/p>\n<p>data_boxcox, _ = boxcox(data - np.min(data) + 1)<\/p>\n<h2><strong>\u7ed8\u5236QQ\u56fe<\/strong><\/h2>\n<p>sm.qqplot(data_boxcox, line=&#39;45&#39;)<\/p>\n<p>plt.title(&#39;QQ Plot (Box-Cox Transformed Data)&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u9a8c\u8bc1\u6570\u636e\u662f\u5426\u670d\u4ece\u6b63\u6001\u5206\u5e03\u662f\u6570\u636e\u5206\u6790\u4e2d\u7684\u91cd\u8981\u6b65\u9aa4\u3002\u901a\u8fc7\u76f4\u65b9\u56fe\u548cQQ\u56fe\uff0c\u53ef\u4ee5\u76f4\u89c2\u5730\u89c2\u5bdf\u6570\u636e\u5206\u5e03\u60c5\u51b5\uff1b\u901a\u8fc7Shapiro-Wilk\u68c0\u9a8c\u3001Kolmogorov-Smirnov\u68c0\u9a8c\u3001Anderson-Darling\u68c0\u9a8c\u548cD\u2019Agostino\u2019s K-squared Test\u7b49\u7edf\u8ba1\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5b9a\u91cf\u5730\u5224\u65ad\u6570\u636e\u662f\u5426\u670d\u4ece\u6b63\u6001\u5206\u5e03\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u7ed3\u5408\u591a\u79cd\u65b9\u6cd5\u8fdb\u884c\u9a8c\u8bc1\uff0c\u53ef\u4ee5\u63d0\u9ad8\u5224\u65ad\u7684\u51c6\u786e\u6027\u3002\u5982\u679c\u6570\u636e\u4e0d\u670d\u4ece\u6b63\u6001\u5206\u5e03\uff0c\u53ef\u4ee5\u901a\u8fc7\u6807\u51c6\u5316\u3001\u5bf9\u6570\u53d8\u6362\u3001Box-Cox\u53d8\u6362\u7b49\u65b9\u6cd5\u5bf9\u6570\u636e\u8fdb\u884c\u9884\u5904\u7406\u548c\u8f6c\u6362\uff0c\u4f7f\u6570\u636e\u66f4\u52a0\u63a5\u8fd1\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u6b63\u6001\u5206\u5e03\u7684\u53ef\u89c6\u5316\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u7ed8\u5236\u76f4\u65b9\u56fe\u548cQ-Q\u56fe\u6765\u53ef\u89c6\u5316\u6570\u636e\u7684\u6b63\u6001\u5206\u5e03\u3002\u4f7f\u7528Matplotlib\u548cSeaborn\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u76f4\u65b9\u56fe\uff1b\u800c\u4f7f\u7528SciPy\u5e93\u7684probplot\u51fd\u6570\u53ef\u4ee5\u751f\u6210Q-Q\u56fe\u3002\u8fd9\u4e9b\u56fe\u5f62\u80fd\u5e2e\u52a9\u5224\u65ad\u6570\u636e\u662f\u5426\u7b26\u5408\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u6709\u54ea\u4e9b\u7edf\u8ba1\u65b9\u6cd5\u53ef\u4ee5\u68c0\u9a8c\u6570\u636e\u7684\u6b63\u6001\u6027\uff1f<\/strong><br \/>\u5e38\u89c1\u7684\u7edf\u8ba1\u68c0\u9a8c\u65b9\u6cd5\u5305\u62ecShapiro-Wilk\u68c0\u9a8c\u548cKolmogorov-Smirnov\u68c0\u9a8c\u3002Shapiro-Wilk\u68c0\u9a8c\u9002\u7528\u4e8e\u5c0f\u6837\u672c\u6570\u636e\uff0c\u800cKolmogorov-Smirnov\u68c0\u9a8c\u5219\u9002\u7528\u4e8e\u5927\u6837\u672c\u6570\u636e\u3002\u4f7f\u7528SciPy\u5e93\u4e2d\u7684\u76f8\u5173\u51fd\u6570\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u8fd9\u4e9b\u68c0\u9a8c\uff0c\u5e76\u83b7\u5f97p\u503c\u4ee5\u5224\u65ad\u6570\u636e\u662f\u5426\u7b26\u5408\u6b63\u6001\u5206\u5e03\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u4e0d\u7b26\u5408\u6b63\u6001\u5206\u5e03\u7684\u6570\u636e\uff1f<\/strong><br \/>\u5f53\u6570\u636e\u4e0d\u7b26\u5408\u6b63\u6001\u5206\u5e03\u65f6\uff0c\u53ef\u4ee5\u8003\u8651\u8fdb\u884c\u6570\u636e\u8f6c\u6362\uff0c\u5982\u5bf9\u6570\u8f6c\u6362\u3001\u5e73\u65b9\u6839\u8f6c\u6362\u6216Box-Cox\u8f6c\u6362\u3002\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u6570\u636e\u66f4\u63a5\u8fd1\u6b63\u6001\u5206\u5e03\u3002\u6b64\u5916\uff0c\u4e5f\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u975e\u53c2\u6570\u7edf\u8ba1\u65b9\u6cd5\u6765\u5206\u6790\u6570\u636e\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u65b9\u6cd5\u5bf9\u6570\u636e\u5206\u5e03\u7684\u5047\u8bbe\u8981\u6c42\u8f83\u4f4e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u9a8c\u8bc1\u6570\u636e\u6b63\u6001\u5206\u5e03python \u4f7f\u7528\u76f4\u65b9\u56fe\u548cQQ\u56fe\u3001Shapiro-Wilk\u68c0\u9a8c\u3001Kolmogorov-Sm [&hellip;]","protected":false},"author":3,"featured_media":1164325,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1164317"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1164317"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1164317\/revisions"}],"predecessor-version":[{"id":1164327,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1164317\/revisions\/1164327"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1164325"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1164317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1164317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1164317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}