{"id":56005,"date":"2025-02-22T09:24:50","date_gmt":"2025-02-22T01:24:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/56005\/"},"modified":"2025-02-22T09:24:50","modified_gmt":"2025-02-22T01:24:50","slug":"%e8%87%aa%e5%8a%a8%e7%bc%96%e7%a8%8b_it%e4%b8%93%e7%94%a8prompt","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/56005\/","title":{"rendered":"\u81ea\u52a8\u7f16\u7a0b_IT\u4e13\u7528Prompt"},"content":{"rendered":"<h1>\u81ea\u52a8\u8bad\u7ec3\u5206\u7c7b\u6a21\u578b<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u6211\u6709\u4e00\u4efd [ \u6570\u636e\u96c6\u540d\u79f0 ] \u6570\u636e\u96c6\uff0c\u8bf7\u7528 Python \u5199\u4e00\u4e2a\u80fd\u9884\u6d4b [ \u6807\u7b7e\u5217\u540d\u79f0 ] \u7684\u673a\u5668\u5b66\u4e60\u6a21\u578b<\/p>\n<p> <\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u6211\u6709\u4e00\u4efd [ iris ] \u6570\u636e\u96c6\uff0c\u8bf7\u7528 Python \u5199\u4e00\u4e2a\u80fd\u9884\u6d4b [ types ] \u7684\u673a\u5668\u5b66\u4e60\u6a21\u578b<\/p>\n<h1>\u81ea\u52a8\u6570\u636e\u63a2\u7d22<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u6211\u6709\u4e00\u4efd [ \u6570\u636e\u96c6\u540d\u79f0 ] \u6570\u636e\u96c6\uff0c\u8bf7\u7528 Python \u7f16\u5199\u6570\u636e\u53ef\u89c6\u5316\u63a2\u7d22\u4ee3\u7801<\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u6211\u6709\u4e00\u4efd [ \u7528\u6237\u6d41\u5931 ] \u6570\u636e\u96c6\uff0c\u8bf7\u7528 Python \u7f16\u5199\u6570\u636e\u53ef\u89c6\u5316\u63a2\u7d22\u4ee3\u7801<\/p>\n<h1>\u81ea\u52a8\u751f\u6210\u6570\u636e<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u6211\u9700\u8981\u751f\u6210\u4e00\u4efd\u968f\u673a\u5047\u6570\u636e\uff0c\u8bf7\u63d0\u4f9b\u751f\u6210\u4e00\u4efd&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ X ]&nbsp;<\/strong>\u884c\uff0c<strong>&lt;&lt;font color=&#8221;&#8221;&gt;[ y ]&nbsp;<\/strong>\u5217:&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ &#8220;\u7279\u5f811&#8221;, &#8220;\u7279\u5f812&#8221;, &#8220;\u7279\u5f813&#8221; &#8230; &#8220;\u7279\u5f81y&#8221; ]<\/strong>&nbsp;\u7684 Python \u4ee3\u7801<\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u6211\u9700\u8981\u751f\u6210\u4e00\u4efd\u968f\u673a\u5047\u6570\u636e\uff0c\u8bf7\u63d0\u4f9b\u751f\u6210\u4e00\u4efd&nbsp;<strong>[ 1000 ]<\/strong>&nbsp;\u884c\uff0c<strong>[ 4 ]<\/strong>&nbsp;\u5217:&nbsp;<strong>[ &#8220;\u5361\u53f7&#8221;, &#8220;\u4fe1\u7528\u989d\u5ea6&#8221;, &#8220;\u662f\u5426\u903e\u671f&#8221;, &#8220;\u6301\u5361\u65f6\u957f&#8221; ]<\/strong>&nbsp;\u7684 Python \u4ee3\u7801<\/p>\n<h1>\u81ea\u52a8\u7f16\u5199\u6b63\u5219\u8868\u8fbe\u5f0f<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u8bf7\u7528 Python \u5e2e\u6211\u7f16\u5199\u4e00\u4e2a regex \u7528\u4e8e\u5339\u914d\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\u7684\u5b57\u7b26\u4e32\uff1a<strong>&lt;font color=&#8221;&#8221;&gt;[ \u5339\u914d\u6761\u4ef6 ]<\/strong><\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u8bf7\u7528 Python \u5e2e\u6211\u7f16\u5199\u4e00\u4e2a regex \u7528\u4e8e\u5339\u914d\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\u7684\u5b57\u7b26\u4e32\uff1a<strong>[ \u5305\u542b\u5355\u8bcd &#8220;machine&#8221; \u548c &#8220;learning&#8221;, \u5e76\u4e14\u4ee5\u611f\u53f9\u53f7\u7ed3\u675f ]<\/strong><\/p>\n<h1>\u8bad\u7ec3\u65f6\u95f4\u5e8f\u5217\u6a21\u578b<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u6211\u5728\u672c\u5730\u6709\u4e00\u4efd&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u6570\u636e\u96c6\u63cf\u8ff0 ]<\/strong>&nbsp;\u7684\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u96c6\uff0c\u8bf7\u4f7f\u7528 Python \u7f16\u5199\u4e00\u4e2a\u673a\u5668\u5b66\u4e60\u6a21\u578b\uff0c\u9884\u6d4b\u6210\u4ea4\u4ef7\u683c\u5217&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u6807\u7b7e ]<\/strong>\uff0c\u8bf7\u4f7f\u7528&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u8bad\u7ec3\u96c6\u63cf\u8ff0 ]<\/strong>&nbsp;\u4f5c\u4e3a\u8bad\u7ec3\u96c6\uff0c\u4f7f\u7528&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u9a8c\u8bc1\u96c6\u63cf\u8ff0 ]<\/strong>&nbsp;\u4f5c\u4e3a\u9a8c\u8bc1\u96c6**<\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u6211\u5728\u672c\u5730\u6709\u4e00\u4efd&nbsp;<strong>[ 2010\/01\/01 \u5230 2020\/01\/17 ]<\/strong>&nbsp;\u7684\u82f9\u679c\u516c\u53f8\u80a1\u7968\u4ea4\u6613\u4ef7\u683c\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u96c6\uff0c\u8bf7\u4f7f\u7528 Python \u7f16\u5199\u4e00\u4e2a\u673a\u5668\u5b66\u4e60\u6a21\u578b\uff0c\u9884\u6d4b\u6210\u4ea4\u4ef7\u683c\u5217&nbsp;<strong>[ close ]<\/strong>\uff0c\u8bf7\u4f7f\u7528&nbsp;<strong>[ 2010\/01\/01 \u5230 2018\/12\/31 \u7684\u6570\u636e ]<\/strong>&nbsp;\u4f5c\u4e3a\u8bad\u7ec3\u96c6\uff0c\u4f7f\u7528&nbsp;<strong>[ 2019\/01\/01 \u5230 2020\/01\/17 \u7684\u6570\u636e ]<\/strong>&nbsp;\u4f5c\u4e3a\u9a8c\u8bc1\u96c6<\/p>\n<h1>\u8c03\u6574\u4e0d\u5747\u8861\u6570\u636e<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u6211\u6709\u4e00\u4efd\u4e0d\u5747\u8861\u6570\u636e\uff0c\u9700\u8981\u5728\u4e0a\u9762\u8bad\u7ec3\u673a\u5668\u5b66\u4e60\u6a21\u578b\uff0c\u9884\u6d4b\u53d8\u91cf\u662f&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u76ee\u6807\u53d8\u91cf ]<\/strong>\uff0c\u5982\u4f55\u5728 Python \u4e2d\u5bf9\u6211\u7684\u6570\u636e\u6267\u884c\u8fc7\u91c7\u6837\u6216\u8005\u6b20\u91c7\u6837<\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u6211\u6709\u4e00\u4efd\u4e0d\u5747\u8861\u6570\u636e\uff0c\u9700\u8981\u5728\u4e0a\u9762\u8bad\u7ec3\u673a\u5668\u5b66\u4e60\u6a21\u578b\uff0c\u9884\u6d4b\u53d8\u91cf\u662f&nbsp;<strong>[ smoking ]<\/strong>\uff0c\u5982\u4f55\u5728 Python \u4e2d\u5bf9\u6211\u7684\u6570\u636e\u6267\u884c\u8fc7\u91c7\u6837\u6216\u8005\u6b20\u91c7\u6837<\/p>\n<h1>\u83b7\u53d6\u7279\u5f81\u91cd\u8981\u5ea6<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u6211\u8bad\u7ec3\u4e86\u4e00\u4e2a&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u6a21\u578b\u7c7b\u578b ]<\/strong>\uff0c\u8bf7\u5e2e\u6211\u7f16\u5199 Python \u4ee3\u7801\uff0c\u627e\u51fa\u6700\u91cd\u8981\u7684\u7279\u5f81<\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u6211\u8bad\u7ec3\u4e86\u4e00\u4e2a&nbsp;<strong>[ \u51b3\u7b56\u6811\u6a21\u578b ]<\/strong>\uff0c\u8bf7\u5e2e\u6211\u7f16\u5199 Python \u4ee3\u7801\uff0c\u627e\u51fa\u6700\u91cd\u8981\u7684\u7279\u5f81<\/p>\n<h1>\u81ea\u52a8\u6570\u636e\u53ef\u89c6\u5316<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u6211\u6709\u4e00\u4e2a\u6570\u636e\u96c6&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u6570\u636e\u96c6\u540d\u79f0 ]<\/strong>\uff0c\u5305\u542b\u5217\uff1a<strong>&lt;font color=&#8221;&#8221;&gt;[ &#8220;\u7279\u5f811&#8221;, &#8220;\u7279\u5f812&#8221;, &#8220;\u7279\u5f813&#8221; &#8230; \u7b49\u7b49 ]<\/strong>\uff0c\u6211\u60f3\u4f60\u5e2e\u6211\u7ed8\u5236\u4e00\u4efd\u6570\u636e\u53ef\u89c6\u5316\u56fe\u8868\uff0c<strong>&lt;font color=&#8221;&#8221;&gt;[ \u56fe\u8868\u9700\u6c42\u63cf\u8ff0 ]<\/strong><\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u6211\u6709\u4e00\u4e2a\u6570\u636e\u96c6&nbsp;<strong>[ smoking.csv ]<\/strong>\uff0c\u5305\u542b\u5217\uff1a<strong>[ &#8220;smoking&#8221;, &#8220;gender&#8221;, &#8220;age&#8221; &#8230; \u7b49\u7b49 ]<\/strong>\uff0c\u6211\u60f3\u4f60\u5e2e\u6211\u7ed8\u5236\u4e00\u4efd\u6570\u636e\u53ef\u89c6\u5316\u56fe\u8868\uff0c<strong>[ \u56fe\u8868\u80fd\u53cd\u5e94\u51fa\u5404\u4e2a\u7279\u5f81\u5217\u4e0e\u662f\u5426 &#8220;smoking&#8221; \u4e4b\u95f4\u7684\u5173\u8054\uff0c\u8bf7\u4f7f\u7528 Matplotlib \u5b8c\u6210\uff0c\u8bf7\u5e2e\u6211\u9009\u62e9\u5177\u6709\u5438\u5f15\u529b\u7684\u914d\u8272\u548c\u9002\u5408\u7528\u4e8e\u6c47\u62a5\u7684\u5c3a\u5bf8 ]<\/strong><\/p>\n<h1>\u521b\u5efa NumPy \u6570\u7ec4<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u6211\u60f3\u4f60\u4f5c\u4e3a\u4e00\u4e2a\u6570\u636e\u5206\u6790\u5e08\uff0c\u5e2e\u6211\u521b\u5efa\u4e00\u4e2a NumPy \u6570\u7ec4\uff0c\u6570\u7ec4\u5f62\u72b6\u4e3a&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;( x, y, z )<\/strong>\uff0c\u8bf7\u5728&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ i \u5230 j ]<\/strong>&nbsp;\u4e4b\u95f4\u968f\u673a\u751f\u6210\u6570\u7ec4\u521d\u59cb\u503c\uff0c\u5e76\u5c06\u5176\u8f93\u51fa<\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u6211\u60f3\u4f60\u4f5c\u4e3a\u4e00\u4e2a\u6570\u636e\u5206\u6790\u5e08\uff0c\u5e2e\u6211\u521b\u5efa\u4e00\u4e2a NumPy \u6570\u7ec4\uff0c\u6570\u7ec4\u5f62\u72b6\u4e3a&nbsp;<strong>( 3, 4, 10 )<\/strong>\uff0c\u8bf7\u5728&nbsp;<strong>[ 1 \u5230 10 ]<\/strong>&nbsp;\u4e4b\u95f4\u968f\u673a\u751f\u6210\u6570\u7ec4\u521d\u59cb\u503c\uff0c\u5e76\u5c06\u5176\u8f93\u51fa<\/p>\n<h1>\u7279\u5f81\u5217\u9a8c\u8bc1<\/h1>\n<h3>\u6307\u4ee4\u683c\u5f0f<\/h3>\n<p>\u68c0\u67e5\u6211\u7684\u6570\u636e\u96c6&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u6570\u636e\u96c6\u540d\u79f0 ]<\/strong>&nbsp;\u4e2d\uff0c\u662f\u5426\u5b58\u5728&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u68c0\u67e5\u5bf9\u8c61 ]<\/strong>\uff0c\u5982\u679c&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u662f ]<\/strong>\uff0c\u8bf7&nbsp;<strong>&lt;font color=&#8221;&#8221;&gt;[ \u64cd\u4f5c ]<\/strong><\/p>\n<h3>\u6307\u4ee4\u793a\u4f8b<\/h3>\n<p>\u68c0\u67e5\u6211\u7684\u6570\u636e\u96c6&nbsp;<strong>[ house.csv ]<\/strong>&nbsp;\u4e2d\uff0c\u662f\u5426\u5b58\u5728&nbsp;<strong>[ \u91cd\u590d\u884c\uff0c\u7a7a\u503c\u4ee5\u53ca\u5176\u5b83\u975e\u6cd5\u5b57\u7b26 ]<\/strong>\uff0c\u5982\u679c&nbsp;<strong>[ \u662f ]<\/strong>\uff0c\u8bf7&nbsp;<strong>[ \u5c06\u5b83\u4eec\u7edf\u8ba1\u51fa\u6765\uff0c\u5e76\u79fb\u9664 ]<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u52a8\u8bad\u7ec3\u5206\u7c7b\u6a21\u578b \u6307\u4ee4\u683c\u5f0f \u6211\u6709\u4e00\u4efd [ \u6570\u636e\u96c6\u540d\u79f0 ] \u6570\u636e\u96c6\uff0c\u8bf7\u7528 Python \u5199\u4e00\u4e2a\u80fd\u9884\u6d4b [ \u6807\u7b7e\u5217\u540d\u79f0 ] \u7684\u673a\u5668\u5b66\u4e60\u6a21\u578b \u6307\u4ee4\u793a\u4f8b \u6211\u6709\u4e00\u4efd [ iris ] \u6570\u636e\u96c6\uff0c\u8bf7\u7528 Python \u5199\u4e00\u4e2a\u80fd\u9884\u6d4b [ types ] \u7684\u673a\u5668\u5b66\u4e60\u6a21\u578b \u81ea\u52a8\u6570\u636e\u63a2\u7d22 \u6307\u4ee4\u683c\u5f0f \u6211\u6709\u4e00\u4efd [ \u6570\u636e\u96c6\u540d\u79f0 ] \u6570\u636e\u96c6\uff0c\u8bf7\u7528 Python \u7f16\u5199\u6570\u636e\u53ef\u89c6\u5316\u63a2\u7d22\u4ee3\u7801 \u6307\u4ee4\u793a\u4f8b \u6211\u6709\u4e00\u4efd [ \u7528\u6237\u6d41\u5931 ] \u6570\u636e\u96c6\uff0c\u8bf7\u7528 Python \u7f16\u5199\u6570\u636e\u53ef\u89c6\u5316\u63a2\u7d22\u4ee3\u7801 \u81ea\u52a8\u751f\u6210\u6570\u636e \u6307\u4ee4\u683c\u5f0f \u6211\u9700\u8981\u751f\u6210\u4e00\u4efd\u968f\u673a\u5047\u6570\u636e\uff0c\u8bf7\u63d0\u4f9b\u751f\u6210\u4e00\u4efd&nbsp;&lt;font color=&#8221;&#8221;&gt;[ X ]&nbsp;\u884c\uff0c&lt;&lt;font color=&#8221;&#8221;&gt;[ y ]&nbsp;\u5217:&nbsp;&lt;font color=&#8221;&#8221;&gt;[ &#8220;\u7279\u5f811&#8221;, &#8220;\u7279\u5f812&#8221;, &#8220;\u7279\u5f813&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-56005","post","type-post","status-publish","format-standard","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/56005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=56005"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/56005\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=56005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=56005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=56005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}