{"id":80220,"date":"2026-03-04T17:05:29","date_gmt":"2026-03-04T09:05:29","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/80220.html"},"modified":"2026-03-04T17:05:29","modified_gmt":"2026-03-04T09:05:29","slug":"python%e6%95%b0%e6%8d%ae%e5%88%86%e6%9e%90%ef%bc%9a%e5%88%86%e6%9e%90%e9%b8%a2%e5%b0%be%e8%8a%b1%e7%a7%8d%e7%b1%bb%e6%95%b0%e6%8d%ae%e9%a1%b9%e7%9b%ae%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/80220.html","title":{"rendered":"Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218"},"content":{"rendered":"<h2>Python\u6570\u636e\u5206\u6790&#xff1a;\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218<\/h2>\n<p>\u5927\u5bb6\u597d&#xff01;\u4eca\u5929\u5206\u4eab\u4e00\u4e2a\u7ecf\u5178\u7684\u6570\u636e\u5206\u6790\u9879\u76ee\u2014\u2014\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u5206\u6790\u3002\u6211\u4eec\u5c06\u901a\u8fc7Python\u5bf9\u4e24\u79cd\u9e22\u5c3e\u82b1\u7684\u843c\u7247\u3001\u82b1\u74e3\u7684\u957f\u5ea6\u548c\u5bbd\u5ea6\u8fdb\u884c\u7edf\u8ba1\u68c0\u9a8c&#xff0c;\u63a2\u7a76\u5b83\u4eec\u662f\u5426\u5b58\u5728\u663e\u8457\u6027\u5dee\u5f02\u3002\u6574\u4e2a\u8fc7\u7a0b\u5305\u62ec\u6570\u636e\u8bfb\u53d6\u3001\u6e05\u6d17\u3001\u63a2\u7d22\u6027\u5206\u6790\u548c\u5047\u8bbe\u68c0\u9a8c&#xff0c;\u4ee3\u7801\u5b8c\u6574&#xff0c;\u9002\u5408\u521d\u5b66\u8005\u5b66\u4e60\u3002\u8ba9\u6211\u4eec\u4e00\u8d77\u5f00\u59cb\u5427&#xff01;&#x1f680;<\/p>\n<h3>&#x1f4cc; \u5206\u6790\u76ee\u6807<\/h3>\n<p>\u672c\u6b21\u5206\u6790\u7684\u76ee\u6807\u662f&#xff1a;\u57fa\u4e8e\u9e22\u5c3e\u82b1\u7684\u5c5e\u6027\u6570\u636e&#xff0c;\u5206\u6790\u4e24\u79cd\u9e22\u5c3e\u82b1&#xff08;Setosa\u548cVersicolor&#xff09;\u843c\u7247\u3001\u82b1\u74e3\u7684\u957f\u5ea6\u548c\u5bbd\u5ea6\u5e73\u5747\u503c\u662f\u5426\u5b58\u5728\u663e\u8457\u6027\u5dee\u5f02&#xff0c;\u4ece\u800c\u5bf9\u4e0d\u540c\u79cd\u7c7b\u9e22\u5c3e\u82b1\u7684\u5c5e\u6027\u7279\u5f81\u8fdb\u884c\u63a8\u65ad\u3002<\/p>\n<h3>&#x1f4c1; \u6570\u636e\u7b80\u4ecb<\/h3>\n<p>\u539f\u59cb\u6570\u636e\u6587\u4ef6\u4e3a\u00a0Iris.csv&#xff0c;\u5305\u542b\u4e24\u79cd\u9e22\u5c3e\u82b1&#xff0c;\u6bcf\u79cd50\u4e2a\u6837\u672c\u3002\u6bcf\u5217\u542b\u4e49\u5982\u4e0b&#xff1a;<\/p>\n<ul>\n<li>\n<p>Id&#xff1a;\u6837\u672cID<\/p>\n<\/li>\n<li>\n<p>SepalLengthCm&#xff1a;\u843c\u7247\u957f\u5ea6&#xff08;\u5398\u7c73&#xff09;<\/p>\n<\/li>\n<li>\n<p>SepalWidthCm&#xff1a;\u843c\u7247\u5bbd\u5ea6&#xff08;\u5398\u7c73&#xff09;<\/p>\n<\/li>\n<li>\n<p>PetalLengthCm&#xff1a;\u82b1\u74e3\u957f\u5ea6&#xff08;\u5398\u7c73&#xff09;<\/p>\n<\/li>\n<li>\n<p>PetalWidthCm&#xff1a;\u82b1\u74e3\u5bbd\u5ea6&#xff08;\u5398\u7c73&#xff09;<\/p>\n<\/li>\n<li>\n<p>Species&#xff1a;\u9e22\u5c3e\u82b1\u79cd\u7c7b&#xff08;Iris-setosa \u6216 Iris-versicolor&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h3>&#x1f4e5; 1. \u8bfb\u53d6\u6570\u636e<\/h3>\n<p>\u9996\u5148\u5bfc\u5165\u5fc5\u8981\u7684\u5e93&#xff0c;\u5e76\u7528Pandas\u8bfb\u53d6\u6570\u636e\u3002<\/p>\n<p>import\u00a0pandas\u00a0as\u00a0pd<br \/>\nimport\u00a0matplotlib.pyplot\u00a0as\u00a0plt<br \/>\nimport\u00a0seaborn\u00a0as\u00a0sns<\/p>\n<p>original_data &#061; pd.read_csv(&#034;Iris.csv&#034;)<br \/>\noriginal_data.head()<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"266\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090526-69a7f5d6af4c2.png\" width=\"870\" \/><\/p>\n<p>\u8f93\u51fa\u7ed3\u679c\u5c55\u793a\u4e86\u524d5\u884c\u6570\u636e&#xff0c;\u6bcf\u4e2a\u6837\u672c\u90fd\u6709\u5bf9\u5e94\u7684ID\u3001\u957f\u5ea6\u5bbd\u5ea6\u548c\u79cd\u7c7b\u3002<\/p>\n<h3>&#x1f9f9; 2. \u8bc4\u4f30\u548c\u6e05\u7406\u6570\u636e<\/h3>\n<p>\u521b\u5efa\u6570\u636e\u526f\u672c&#xff0c;\u4ee5\u4fbf\u5728\u6e05\u7406\u65f6\u4fdd\u7559\u539f\u59cb\u6570\u636e\u3002<\/p>\n<p>cleaned_data &#061; original_data.copy()<\/p>\n<h4>2.1 \u6570\u636e\u6574\u9f50\u5ea6\u68c0\u67e5<\/h4>\n<p>\u68c0\u67e5\u6570\u636e\u662f\u5426\u7b26\u5408\u201c\u6bcf\u4e2a\u53d8\u91cf\u4e3a\u4e00\u5217&#xff0c;\u6bcf\u4e2a\u89c2\u5bdf\u503c\u4e3a\u4e00\u884c\u201d\u7684\u89c4\u8303\u3002\u67e5\u770b\u524d10\u884c\u6570\u636e&#xff0c;\u786e\u8ba4\u7ed3\u6784\u826f\u597d\u3002<\/p>\n<p>cleaned_data.head(10)<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"493\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090526-69a7f5d6cedf1.png\" width=\"864\" \/><\/p>\n<h4>2.2 \u6570\u636e\u5e72\u51c0\u5ea6\u5904\u7406<\/h4>\n<h5>\u57fa\u672c\u4fe1\u606f\u67e5\u770b<\/h5>\n<p>\u4f7f\u7528\u00a0info()\u00a0\u67e5\u770b\u6570\u636e\u7c7b\u578b\u548c\u7f3a\u5931\u503c\u60c5\u51b5\u3002<\/p>\n<p>cleaned_data.info()<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"340\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090526-69a7f5d6f1eeb.png\" width=\"482\" \/><\/p>\n<p>\u7ed3\u679c\u663e\u793a\u5171\u6709100\u6761\u8bb0\u5f55&#xff0c;\u65e0\u7f3a\u5931\u503c\u3002\u4f46Id\u5217\u5e94\u4e3a\u5b57\u7b26\u4e32\u7c7b\u578b&#xff0c;\u9700\u8981\u8f6c\u6362\u3002<\/p>\n<p>cleaned_data[&#034;Id&#034;] &#061; cleaned_data[&#034;Id&#034;].astype(&#034;str&#034;)<br \/>\ncleaned_data[&#034;Id&#034;]<\/p>\n<h5>\u7f3a\u5931\u6570\u636e\u5904\u7406<\/h5>\n<p>info()\u5df2\u663e\u793a\u65e0\u7f3a\u5931\u503c&#xff0c;\u65e0\u9700\u5904\u7406\u3002<\/p>\n<h5>\u91cd\u590d\u6570\u636e\u5904\u7406<\/h5>\n<p>\u68c0\u67e5Id\u662f\u5426\u6709\u91cd\u590d\u503c&#xff1a;<\/p>\n<p>cleaned_data[&#034;Id&#034;].duplicated().sum()<\/p>\n<p>\u8f93\u51fa0&#xff0c;\u65e0\u91cd\u590d\u6570\u636e\u3002<\/p>\n<h5>\u4e0d\u4e00\u81f4\u6570\u636e\u5904\u7406<\/h5>\n<p>\u67e5\u770bSpecies\u5217\u7684\u552f\u4e00\u503c&#xff1a;<\/p>\n<p>cleaned_data[&#034;Species&#034;].value_counts()<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"106\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090527-69a7f5d70e5c8.png\" width=\"329\" \/><\/p>\n<p>\u7ed3\u679c\u53ea\u6709\u4e24\u79cd\u7c7b\u522b&#xff1a;Iris-setosa\u548cIris-versicolor&#xff0c;\u65e0\u4e0d\u4e00\u81f4\u6570\u636e\u3002\u6211\u4eec\u5c06\u8be5\u5217\u8f6c\u6362\u4e3acategory\u7c7b\u578b\u4ee5\u8282\u7701\u5185\u5b58\u3002<\/p>\n<p>cleaned_data[&#034;Species&#034;] &#061; cleaned_data[&#034;Species&#034;].astype(&#034;category&#034;)<br \/>\ncleaned_data[&#034;Species&#034;]<\/p>\n<h5><\/h5>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"350\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090527-69a7f5d718979.png\" width=\"655\" \/><\/p>\n<h5>\u65e0\u6548\u6216\u9519\u8bef\u6570\u636e\u5904\u7406<\/h5>\n<p>\u4f7f\u7528\u00a0describe()\u00a0\u67e5\u770b\u6570\u503c\u5217\u7684\u7edf\u8ba1\u4fe1\u606f&#xff0c;\u786e\u8ba4\u65e0\u5f02\u5e38\u503c\u3002<\/p>\n<p>cleaned_data.describe()<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"398\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090527-69a7f5d728869.png\" width=\"741\" \/><\/p>\n<p>\u6240\u6709\u6570\u503c\u5747\u5728\u5408\u7406\u8303\u56f4\u5185&#xff0c;\u65e0\u9700\u5904\u7406\u3002<\/p>\n<h3>&#x1f4ca; 3. \u6574\u7406\u6570\u636e<\/h3>\n<p>\u6839\u636e\u5206\u6790\u76ee\u6807&#xff0c;\u6211\u4eec\u9700\u8981\u5c06\u4e24\u79cd\u9e22\u5c3e\u82b1\u7684\u6570\u636e\u5206\u5f00\u3002<\/p>\n<p>iris_setosa &#061; cleaned_data.query(&#039;Species &#061;&#061; &#034;Iris-setosa&#034;&#039;)<br \/>\niris_setosa.head()<\/p>\n<p>len(iris_setosa) \u00a0# 50<\/p>\n<p>iris_versicolor &#061; cleaned_data.query(&#039;Species &#061;&#061; &#034;Iris-versicolor&#034;&#039;)<br \/>\niris_versicolor.head()<\/p>\n<p>len(iris_versicolor) \u00a0# 50<\/p>\n<h3>&#x1f50d; 4. \u63a2\u7d22\u6570\u636e<\/h3>\n<p>\u4f7f\u7528pairplot\u53ef\u89c6\u5316\u4e24\u79cd\u9e22\u5c3e\u82b1\u5404\u7279\u5f81\u7684\u5206\u5e03\u5173\u7cfb&#xff0c;\u989c\u8272\u533a\u5206\u79cd\u7c7b\u3002<\/p>\n<p>sns.pairplot(cleaned_data, hue&#061;&#034;Species&#034;)<br \/>\nplt.show()<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"935\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090527-69a7f5d73d824.png\" width=\"1080\" \/><\/p>\n<p>\u4ece\u56fe\u4e2d\u53ef\u4ee5\u770b\u51fa&#xff0c;\u82b1\u74e3\u957f\u5ea6\u548c\u5bbd\u5ea6\u5728\u4e24\u7c7b\u4e4b\u95f4\u5dee\u5f02\u660e\u663e&#xff0c;\u800c\u843c\u7247\u957f\u5ea6\u548c\u5bbd\u5ea6\u6709\u4e00\u5b9a\u91cd\u53e0&#xff0c;\u9700\u8fdb\u4e00\u6b65\u7edf\u8ba1\u68c0\u9a8c\u3002<\/p>\n<h3>&#x1f4c8; 5. \u5206\u6790\u6570\u636e<\/h3>\n<p>\u6211\u4eec\u5c06\u5bf9\u843c\u7247\u957f\u5ea6\u3001\u843c\u7247\u5bbd\u5ea6\u3001\u82b1\u74e3\u957f\u5ea6\u3001\u82b1\u74e3\u5bbd\u5ea6\u5206\u522b\u8fdb\u884c\u72ec\u7acb\u6837\u672ct\u68c0\u9a8c&#xff0c;\u5224\u65ad\u5747\u503c\u662f\u5426\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<p>\u5f15\u5165t\u68c0\u9a8c\u6a21\u5757&#xff1a;<\/p>\n<p>from\u00a0scipy.stats\u00a0import\u00a0ttest_ind<\/p>\n<h4>5.1 \u843c\u7247\u957f\u5ea6\u5206\u6790<\/h4>\n<h5>\u5206\u5e03\u53ef\u89c6\u5316<\/h5>\n<p>sns.histplot(iris_setosa[&#039;SepalLengthCm&#039;], binwidth&#061;0.1)<br \/>\nsns.histplot(iris_versicolor[&#039;SepalLengthCm&#039;], binwidth&#061;0.1)<br \/>\nplt.show()<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"387\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090527-69a7f5d7a6fc0.png\" width=\"575\" \/><\/p>\n<h5>\u5047\u8bbe\u68c0\u9a8c<\/h5>\n<ul>\n<li>\n<p>\u539f\u5047\u8bbeH\u2080&#xff1a;\u4e24\u79cd\u9e22\u5c3e\u82b1\u843c\u7247\u957f\u5ea6\u5e73\u5747\u503c\u65e0\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<\/li>\n<li>\n<p>\u5907\u62e9\u5047\u8bbeH\u2081&#xff1a;\u4e24\u79cd\u9e22\u5c3e\u82b1\u843c\u7247\u957f\u5ea6\u5e73\u5747\u503c\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<\/li>\n<li>\n<p>\u68c0\u9a8c\u7c7b\u578b&#xff1a;\u53cc\u5c3e\u68c0\u9a8c&#xff08;\u6211\u4eec\u53ea\u5173\u5fc3\u662f\u5426\u6709\u5dee\u5f02&#xff0c;\u4e0d\u5173\u5fc3\u8c01\u5927\u8c01\u5c0f&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u663e\u8457\u6027\u6c34\u5e73\u03b1&#xff1a;0.05<\/p>\n<\/li>\n<\/ul>\n<p>t_stat, p_value &#061; ttest_ind(iris_setosa[&#034;SepalLengthCm&#034;], iris_versicolor[&#034;SepalLengthCm&#034;])<br \/>\nprint(f&#034;t\u503c&#xff1a;{t_stat}&#034;)<br \/>\nprint(f&#034;p\u503c&#xff1a;{p_value}&#034;)<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>t\u503c&#xff1a;-10.52098626754911<br \/>\np\u503c&#xff1a;8.985235037487079e-18<\/p>\n<p>\u7ed3\u8bba&#xff1a;p\u503c\u8fdc\u5c0f\u4e8e0.05&#xff0c;\u62d2\u7edd\u539f\u5047\u8bbe&#xff0c;\u4e24\u79cd\u9e22\u5c3e\u82b1\u843c\u7247\u957f\u5ea6\u5747\u503c\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<h4>5.2 \u843c\u7247\u5bbd\u5ea6\u5206\u6790<\/h4>\n<h5>\u5206\u5e03\u53ef\u89c6\u5316<\/h5>\n<p>sns.histplot(iris_setosa[&#039;SepalWidthCm&#039;], binwidth&#061;0.1)<br \/>\nsns.histplot(iris_versicolor[&#039;SepalWidthCm&#039;], binwidth&#061;0.1)<br \/>\nplt.show()<\/p>\n<h5><\/h5>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"388\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090527-69a7f5d7be32b.png\" width=\"616\" \/><\/p>\n<h5>\u5047\u8bbe\u68c0\u9a8c<\/h5>\n<ul>\n<li>\n<p>\u539f\u5047\u8bbeH\u2080&#xff1a;\u4e24\u79cd\u9e22\u5c3e\u82b1\u843c\u7247\u5bbd\u5ea6\u5e73\u5747\u503c\u65e0\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<\/li>\n<li>\n<p>\u5907\u62e9\u5047\u8bbeH\u2081&#xff1a;\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<\/li>\n<li>\n<p>\u53cc\u5c3e\u68c0\u9a8c&#xff0c;\u03b1&#061;0.05<\/p>\n<\/li>\n<\/ul>\n<p>t_stat, p_value &#061; ttest_ind(iris_setosa[&#034;SepalWidthCm&#034;], iris_versicolor[&#034;SepalWidthCm&#034;])<br \/>\nprint(f&#034;t\u503c&#xff1a;{t_stat}&#034;)<br \/>\nprint(f&#034;p\u503c&#xff1a;{p_value}&#034;)<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>t\u503c&#xff1a;9.282772555558111<br \/>\np\u503c&#xff1a;4.362239016010214e-15<\/p>\n<p>\u7ed3\u8bba&#xff1a;p\u503c &lt; 0.05&#xff0c;\u62d2\u7edd\u539f\u5047\u8bbe&#xff0c;\u843c\u7247\u5bbd\u5ea6\u5747\u503c\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<h4>5.3 \u82b1\u74e3\u957f\u5ea6\u5206\u6790<\/h4>\n<h5>\u5206\u5e03\u53ef\u89c6\u5316<\/h5>\n<p>sns.histplot(iris_setosa[&#039;PetalLengthCm&#039;], binwidth&#061;0.1)<br \/>\nsns.histplot(iris_versicolor[&#039;PetalLengthCm&#039;], binwidth&#061;0.1)<br \/>\nplt.show()<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"392\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090527-69a7f5d7d2fc2.png\" width=\"604\" \/><\/p>\n<h5>\u5047\u8bbe\u68c0\u9a8c<\/h5>\n<p>t_stat, p_value &#061; ttest_ind(iris_setosa[&#034;PetalLengthCm&#034;], iris_versicolor[&#034;PetalLengthCm&#034;])<br \/>\nprint(f&#034;t\u503c&#xff1a;{t_stat}&#034;)<br \/>\nprint(f&#034;p\u503c&#xff1a;{p_value}&#034;)<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>t\u503c&#xff1a;-39.46866259397272<br \/>\np\u503c&#xff1a;5.717463758170621e-62<\/p>\n<p>\u7ed3\u8bba&#xff1a;p\u503c &lt; 0.05&#xff0c;\u82b1\u74e3\u957f\u5ea6\u5747\u503c\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<h4>5.4 \u82b1\u74e3\u5bbd\u5ea6\u5206\u6790<\/h4>\n<h5>\u5206\u5e03\u53ef\u89c6\u5316<\/h5>\n<p>sns.histplot(iris_setosa[&#039;PetalWidthCm&#039;], binwidth&#061;0.1)<br \/>\nsns.histplot(iris_versicolor[&#039;PetalWidthCm&#039;], binwidth&#061;0.1)<br \/>\nplt.show()<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u56fe\u7247\" height=\"396\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090527-69a7f5d7e428a.png\" width=\"594\" \/><\/p>\n<h5>\u5047\u8bbe\u68c0\u9a8c<\/h5>\n<p>t_stat, p_value &#061; ttest_ind(iris_setosa[&#034;PetalWidthCm&#034;], iris_versicolor[&#034;PetalWidthCm&#034;])<br \/>\nprint(f&#034;t\u503c&#xff1a;{t_stat}&#034;)<br \/>\nprint(f&#034;p\u503c&#xff1a;{p_value}&#034;)<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>t\u503c&#xff1a;-34.01237858829048<br \/>\np\u503c&#xff1a;4.589080615710866e-56<\/p>\n<p>\u7ed3\u8bba&#xff1a;p\u503c &lt; 0.05&#xff0c;\u82b1\u74e3\u5bbd\u5ea6\u5747\u503c\u5b58\u5728\u663e\u8457\u5dee\u5f02\u3002<\/p>\n<h3>&#x1f4dd; 6. \u7ed3\u8bba<\/h3>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u5206\u6790&#xff0c;\u6211\u4eec\u5f97\u51fa\u4ee5\u4e0b\u7ed3\u8bba&#xff1a;<\/p>\n<ul>\n<li>\n<p>Setosa\u9e22\u5c3e\u82b1\u548cVersicolor\u9e22\u5c3e\u82b1\u5728\u843c\u7247\u957f\u5ea6\u3001\u843c\u7247\u5bbd\u5ea6\u3001\u82b1\u74e3\u957f\u5ea6\u3001\u82b1\u74e3\u5bbd\u5ea6\u7684\u5e73\u5747\u503c\u4e0a\u5747\u5b58\u5728\u7edf\u8ba1\u663e\u8457\u6027\u5dee\u5f02&#xff08;\u6240\u6709p\u503c\u5747\u8fdc\u5c0f\u4e8e0.05&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u672c\u6b21\u9879\u76ee\u5b8c\u6574\u5730\u6f14\u793a\u4e86\u6570\u636e\u6e05\u6d17\u3001\u63a2\u7d22\u6027\u5206\u6790\u548c\u5047\u8bbe\u68c0\u9a8c\u7684\u6d41\u7a0b&#xff0c;\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u6570\u636e\u5206\u6790\u5b66\u4e60\u6709\u6240\u5e2e\u52a9&#xff01;\u5982\u679c\u4f60\u6709\u4efb\u4f55\u95ee\u9898\u6216\u60f3\u6cd5&#xff0c;\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u4ea4\u6d41~ &#x1f4ac;<\/p>\n<hr \/>\n<p>\u275d<\/p>\n<p>&#x1f4a1; \u5b8c\u6574\u4ee3\u7801\u53ca\u6570\u636e\u53ef\u5728\u516c\u4f17\u53f7\u540e\u53f0\u56de\u590d\u300c\u9e22\u5c3e\u82b1\u300d\u83b7\u53d6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\u6570\u636e\u5206\u6790&#xff1a;\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218\u5927\u5bb6\u597d&#xff01;\u4eca\u5929\u5206\u4eab\u4e00\u4e2a\u7ecf\u5178\u7684\u6570\u636e\u5206\u6790\u9879\u76ee\u2014\u2014\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u5206\u6790\u3002\u6211\u4eec\u5c06\u901a\u8fc7Python\u5bf9\u4e24\u79cd\u9e22\u5c3e\u82b1\u7684\u843c\u7247\u3001\u82b1\u74e3\u7684\u957f\u5ea6\u548c\u5bbd\u5ea6\u8fdb\u884c\u7edf\u8ba1\u68c0\u9a8c&#xff0c;\u63a2\u7a76\u5b83\u4eec\u662f\u5426\u5b58\u5728\u663e\u8457\u6027\u5dee\u5f02\u3002\u6574\u4e2a\u8fc7\u7a0b\u5305\u62ec\u6570\u636e\u8bfb\u53d6\u3001\u6e05\u6d17\u3001\u63a2\u7d22\u6027\u5206\u6790\u548c\u5047\u8bbe\u68c0\u9a8c&#xff0c;\u4ee3\u7801\u5b8c\u6574&#xff0c;\u9002\u5408\u521d\u5b66\u8005\u5b66\u4e60\u3002\u8ba9\u6211\u4eec\u4e00\u8d77\u5f00\u59cb\u5427&#xff01;&#x1f680;&#x1f4cc; \u5206\u6790\u76ee\u6807\u672c\u6b21\u5206\u6790\u7684\u76ee\u6807\u662f&#xff1a;\u57fa\u4e8e\u9e22\u5c3e\u82b1\u7684\u5c5e<\/p>\n","protected":false},"author":2,"featured_media":80209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,1224,190,801],"topic":[],"class_list":["post-80220","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-python","tag-1224","tag-190","tag-801"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/80220.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Python\u6570\u636e\u5206\u6790&#xff1a;\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218\u5927\u5bb6\u597d&#xff01;\u4eca\u5929\u5206\u4eab\u4e00\u4e2a\u7ecf\u5178\u7684\u6570\u636e\u5206\u6790\u9879\u76ee\u2014\u2014\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u5206\u6790\u3002\u6211\u4eec\u5c06\u901a\u8fc7Python\u5bf9\u4e24\u79cd\u9e22\u5c3e\u82b1\u7684\u843c\u7247\u3001\u82b1\u74e3\u7684\u957f\u5ea6\u548c\u5bbd\u5ea6\u8fdb\u884c\u7edf\u8ba1\u68c0\u9a8c&#xff0c;\u63a2\u7a76\u5b83\u4eec\u662f\u5426\u5b58\u5728\u663e\u8457\u6027\u5dee\u5f02\u3002\u6574\u4e2a\u8fc7\u7a0b\u5305\u62ec\u6570\u636e\u8bfb\u53d6\u3001\u6e05\u6d17\u3001\u63a2\u7d22\u6027\u5206\u6790\u548c\u5047\u8bbe\u68c0\u9a8c&#xff0c;\u4ee3\u7801\u5b8c\u6574&#xff0c;\u9002\u5408\u521d\u5b66\u8005\u5b66\u4e60\u3002\u8ba9\u6211\u4eec\u4e00\u8d77\u5f00\u59cb\u5427&#xff01;&#x1f680;&#x1f4cc; \u5206\u6790\u76ee\u6807\u672c\u6b21\u5206\u6790\u7684\u76ee\u6807\u662f&#xff1a;\u57fa\u4e8e\u9e22\u5c3e\u82b1\u7684\u5c5e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/80220.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-04T09:05:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090526-69a7f5d6af4c2.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/80220.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/80220.html\",\"name\":\"Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-03-04T09:05:29+00:00\",\"dateModified\":\"2026-03-04T09:05:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/80220.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/80220.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/80220.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/80220.html","og_locale":"zh_CN","og_type":"article","og_title":"Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Python\u6570\u636e\u5206\u6790&#xff1a;\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218\u5927\u5bb6\u597d&#xff01;\u4eca\u5929\u5206\u4eab\u4e00\u4e2a\u7ecf\u5178\u7684\u6570\u636e\u5206\u6790\u9879\u76ee\u2014\u2014\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u5206\u6790\u3002\u6211\u4eec\u5c06\u901a\u8fc7Python\u5bf9\u4e24\u79cd\u9e22\u5c3e\u82b1\u7684\u843c\u7247\u3001\u82b1\u74e3\u7684\u957f\u5ea6\u548c\u5bbd\u5ea6\u8fdb\u884c\u7edf\u8ba1\u68c0\u9a8c&#xff0c;\u63a2\u7a76\u5b83\u4eec\u662f\u5426\u5b58\u5728\u663e\u8457\u6027\u5dee\u5f02\u3002\u6574\u4e2a\u8fc7\u7a0b\u5305\u62ec\u6570\u636e\u8bfb\u53d6\u3001\u6e05\u6d17\u3001\u63a2\u7d22\u6027\u5206\u6790\u548c\u5047\u8bbe\u68c0\u9a8c&#xff0c;\u4ee3\u7801\u5b8c\u6574&#xff0c;\u9002\u5408\u521d\u5b66\u8005\u5b66\u4e60\u3002\u8ba9\u6211\u4eec\u4e00\u8d77\u5f00\u59cb\u5427&#xff01;&#x1f680;&#x1f4cc; \u5206\u6790\u76ee\u6807\u672c\u6b21\u5206\u6790\u7684\u76ee\u6807\u662f&#xff1a;\u57fa\u4e8e\u9e22\u5c3e\u82b1\u7684\u5c5e","og_url":"https:\/\/www.wsisp.com\/helps\/80220.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-03-04T09:05:29+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304090526-69a7f5d6af4c2.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/80220.html","url":"https:\/\/www.wsisp.com\/helps\/80220.html","name":"Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-03-04T09:05:29+00:00","dateModified":"2026-03-04T09:05:29+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/80220.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/80220.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/80220.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Python\u6570\u636e\u5206\u6790\uff1a\u5206\u6790\u9e22\u5c3e\u82b1\u79cd\u7c7b\u6570\u636e\u9879\u76ee\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/80220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=80220"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/80220\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/80209"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=80220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=80220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=80220"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=80220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}