{"id":1070862,"date":"2025-01-08T11:02:08","date_gmt":"2025-01-08T03:02:08","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1070862.html"},"modified":"2025-01-08T11:02:11","modified_gmt":"2025-01-08T03:02:11","slug":"%e8%b4%a2%e5%8a%a1%e5%a4%a7%e6%95%b0%e6%8d%aepython%e5%9f%ba%e7%a1%80%e5%a6%82%e4%bd%95%e6%98%be%e7%a4%ba%e6%95%b0%e5%80%bc-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1070862.html","title":{"rendered":"\u8d22\u52a1\u5927\u6570\u636epython\u57fa\u7840\u5982\u4f55\u663e\u793a\u6570\u503c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25101456\/1a70210b-ac72-40c2-b488-1f09c6d7e42f.webp\" alt=\"\u8d22\u52a1\u5927\u6570\u636epython\u57fa\u7840\u5982\u4f55\u663e\u793a\u6570\u503c\" \/><\/p>\n<p><p> \u4e00\u3001<strong>\u8d22\u52a1\u5927\u6570\u636ePython\u57fa\u7840\u663e\u793a\u6570\u503c\u7684\u65b9\u6cd5<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cPython\u662f\u4e00\u79cd\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\u3002\u8981\u5728Python\u4e2d\u663e\u793a\u6570\u503c\uff0c\u53ef\u4ee5\u4f7f\u7528<strong>print()\u51fd\u6570\u3001\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3001Pandas\u5e93\u3001Matplotlib\u5e93<\/strong>\u7b49\u65b9\u6cd5\u3002<strong>print()\u51fd\u6570<\/strong>\u662f\u6700\u57fa\u672c\u7684\u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u76f4\u63a5\u5c06\u6570\u503c\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002<strong>\u683c\u5f0f\u5316\u5b57\u7b26\u4e32<\/strong>\u53ef\u4ee5\u8ba9\u8f93\u51fa\u7684\u6570\u503c\u66f4\u52a0\u7f8e\u89c2\u548c\u6613\u4e8e\u9605\u8bfb\u3002<strong>Pandas\u5e93<\/strong>\u662f\u8fdb\u884c\u6570\u636e\u5206\u6790\u7684\u5f3a\u5927\u5de5\u5177\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u663e\u793a\u6570\u636e\u6846\u4e2d\u7684\u6570\u503c\u3002<strong>Matplotlib\u5e93<\/strong>\u7528\u4e8e\u7ed8\u5236\u56fe\u8868\uff0c\u53ef\u4ee5\u5c06\u6570\u503c\u4ee5\u56fe\u5f62\u7684\u65b9\u5f0f\u5c55\u793a\u51fa\u6765\u3002<\/p>\n<\/p>\n<p><p>\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u7684Pandas\u5e93\u5728\u663e\u793a\u6570\u503c\u4e2d\u7684\u5e94\u7528\u3002Pandas\u662f\u4e00\u4e2a\u9ad8\u6548\u7684\u6570\u636e\u64cd\u4f5c\u5e93\uff0c\u5b83\u53ef\u4ee5\u8f7b\u677e\u5730\u8bfb\u53d6\u3001\u5904\u7406\u548c\u663e\u793a\u6570\u636e\u3002\u901a\u8fc7Pandas\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u8d22\u52a1\u6570\u636e\u8bfb\u53d6\u5230\u6570\u636e\u6846\u4e2d\uff0c\u7136\u540e\u5229\u7528\u6570\u636e\u6846\u7684\u5404\u79cd\u65b9\u6cd5\u8fdb\u884c\u5904\u7406\u548c\u5c55\u793a\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>pd.read_csv()<\/code>\u51fd\u6570\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e\uff0c\u7136\u540e\u4f7f\u7528<code>DataFrame.head()<\/code>\u65b9\u6cd5\u67e5\u770b\u6570\u636e\u7684\u524d\u51e0\u884c\uff0c\u4f7f\u7528<code>DataFrame.describe()<\/code>\u65b9\u6cd5\u67e5\u770b\u6570\u636e\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u4e86\u89e3\u6570\u636e\u7684\u57fa\u672c\u60c5\u51b5\uff0c\u5e76\u4e3a\u540e\u7eed\u7684\u5206\u6790\u63d0\u4f9b\u57fa\u7840\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001<strong>\u4f7f\u7528print()\u51fd\u6570\u663e\u793a\u6570\u503c<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0cprint()\u51fd\u6570\u662f\u6700\u7b80\u5355\u7684\u663e\u793a\u6570\u503c\u7684\u65b9\u6cd5\u3002\u5b83\u53ef\u4ee5\u76f4\u63a5\u5c06\u53d8\u91cf\u7684\u503c\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u793a\u4f8b\u6765\u4e86\u89e3\u5982\u4f55\u4f7f\u7528print()\u51fd\u6570\u663e\u793a\u6570\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5b9a\u4e49\u4e00\u4e2a\u6570\u503c<\/p>\n<p>value = 100<\/p>\n<h2><strong>\u4f7f\u7528print()\u51fd\u6570\u663e\u793a\u6570\u503c<\/strong><\/h2>\n<p>print(&quot;The value is:&quot;, value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6570\u503c\u53d8\u91cf<code>value<\/code>\uff0c\u7136\u540e\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\u5c06\u8fd9\u4e2a\u6570\u503c\u8f93\u51fa\u5230\u63a7\u5236\u53f0\u3002\u8fd0\u884c\u8fd9\u6bb5\u4ee3\u7801\u540e\uff0c\u63a7\u5236\u53f0\u5c06\u663e\u793a<code>The value is: 100<\/code>\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001<strong>\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u663e\u793a\u6570\u503c<\/strong><\/p>\n<\/p>\n<p><p>\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u53ef\u4ee5\u8ba9\u8f93\u51fa\u7684\u6570\u503c\u66f4\u52a0\u7f8e\u89c2\u548c\u6613\u4e8e\u9605\u8bfb\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>f-string<\/code>\u3001<code>format()<\/code>\u65b9\u6cd5\u4ee5\u53ca\u767e\u5206\u53f7<code>%<\/code>\u6765\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5b9a\u4e49\u4e00\u4e2a\u6570\u503c<\/p>\n<p>value = 100.12345<\/p>\n<h2><strong>\u4f7f\u7528f-string\u683c\u5f0f\u5316\u5b57\u7b26\u4e32<\/strong><\/h2>\n<p>print(f&quot;The value is: {value:.2f}&quot;)<\/p>\n<h2><strong>\u4f7f\u7528format()\u65b9\u6cd5\u683c\u5f0f\u5316\u5b57\u7b26\u4e32<\/strong><\/h2>\n<p>print(&quot;The value is: {:.2f}&quot;.format(value))<\/p>\n<h2><strong>\u4f7f\u7528\u767e\u5206\u53f7%\u683c\u5f0f\u5316\u5b57\u7b26\u4e32<\/strong><\/h2>\n<p>print(&quot;The value is: %.2f&quot; % value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6570\u503c\u53d8\u91cf<code>value<\/code>\uff0c\u5e76\u4f7f\u7528\u4e0d\u540c\u7684\u65b9\u6cd5\u5c06\u5176\u683c\u5f0f\u5316\u4e3a\u4fdd\u7559\u4e24\u4f4d\u5c0f\u6570\u7684\u5b57\u7b26\u4e32\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u63a7\u5236\u53f0\u5c06\u663e\u793a<code>The value is: 100.12<\/code>\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001<strong>\u4f7f\u7528Pandas\u5e93\u663e\u793a\u6570\u503c<\/strong><\/p>\n<\/p>\n<p><p>Pandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5206\u6790\u5e93\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8bfb\u53d6\u3001\u5904\u7406\u548c\u663e\u793a\u6570\u636e\u3002\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cPandas\u7ecf\u5e38\u88ab\u7528\u6765\u5904\u7406\u6570\u636e\u6846\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Pandas\u5e93\u663e\u793a\u6570\u503c\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e<\/strong><\/h2>\n<p>df = pd.read_csv(&#39;financial_data.csv&#39;)<\/p>\n<h2><strong>\u663e\u793a\u6570\u636e\u6846\u7684\u524d\u51e0\u884c<\/strong><\/h2>\n<p>print(df.head())<\/p>\n<h2><strong>\u663e\u793a\u6570\u636e\u6846\u7684\u7edf\u8ba1\u4fe1\u606f<\/strong><\/h2>\n<p>print(df.describe())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86Pandas\u5e93\uff0c\u7136\u540e\u4f7f\u7528<code>pd.read_csv()<\/code>\u51fd\u6570\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u8d22\u52a1\u6570\u636e\uff0c\u5e76\u5c06\u5176\u5b58\u50a8\u5728\u6570\u636e\u6846<code>df<\/code>\u4e2d\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528<code>df.head()<\/code>\u65b9\u6cd5\u663e\u793a\u6570\u636e\u6846\u7684\u524d\u51e0\u884c\uff0c\u4f7f\u7528<code>df.describe()<\/code>\u65b9\u6cd5\u663e\u793a\u6570\u636e\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u4e86\u89e3\u6570\u636e\u7684\u57fa\u672c\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001<strong>\u4f7f\u7528Matplotlib\u5e93\u663e\u793a\u6570\u503c<\/strong><\/p>\n<\/p>\n<p><p>Matplotlib\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7ed8\u56fe\u5e93\uff0c\u53ef\u4ee5\u5c06\u6570\u503c\u4ee5\u56fe\u5f62\u7684\u65b9\u5f0f\u5c55\u793a\u51fa\u6765\u3002\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0c\u5e38\u5e38\u9700\u8981\u901a\u8fc7\u56fe\u8868\u6765\u53ef\u89c6\u5316\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Matplotlib\u5e93\u663e\u793a\u6570\u503c\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u5b9a\u4e49\u6570\u503c\u6570\u636e<\/strong><\/h2>\n<p>values = [100, 200, 300, 400, 500]<\/p>\n<h2><strong>\u7ed8\u5236\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(values)<\/p>\n<p>plt.xlabel(&#39;Index&#39;)<\/p>\n<p>plt.ylabel(&#39;Value&#39;)<\/p>\n<p>plt.title(&#39;Financial Data&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86Matplotlib\u5e93\uff0c\u7136\u540e\u5b9a\u4e49\u4e86\u4e00\u7ec4\u6570\u503c\u6570\u636e<code>values<\/code>\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528<code>plt.plot()<\/code>\u51fd\u6570\u7ed8\u5236\u6298\u7ebf\u56fe\uff0c\u5e76\u4f7f\u7528<code>plt.xlabel()<\/code>\u3001<code>plt.ylabel()<\/code>\u548c<code>plt.title()<\/code>\u51fd\u6570\u8bbe\u7f6e\u56fe\u8868\u7684\u6807\u7b7e\u548c\u6807\u9898\u3002\u6700\u540e\uff0c\u4f7f\u7528<code>plt.show()<\/code>\u51fd\u6570\u663e\u793a\u56fe\u8868\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u5c06\u4f1a\u5f39\u51fa\u4e00\u4e2a\u7a97\u53e3\u663e\u793a\u6298\u7ebf\u56fe\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001<strong>\u7ed3\u5408Pandas\u548cMatplotlib\u663e\u793a\u6570\u503c<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u7684\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cPandas\u548cMatplotlib\u7ecf\u5e38\u7ed3\u5408\u4f7f\u7528\uff0c\u901a\u8fc7Pandas\u5904\u7406\u6570\u636e\uff0c\u7136\u540e\u4f7f\u7528Matplotlib\u8fdb\u884c\u53ef\u89c6\u5316\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7ed3\u5408Pandas\u548cMatplotlib\u663e\u793a\u6570\u503c\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e<\/strong><\/h2>\n<p>df = pd.read_csv(&#39;financial_data.csv&#39;)<\/p>\n<h2><strong>\u663e\u793a\u6570\u636e\u6846\u7684\u524d\u51e0\u884c<\/strong><\/h2>\n<p>print(df.head())<\/p>\n<h2><strong>\u7ed8\u5236\u6570\u636e\u6846\u4e2d\u7684\u6570\u503c<\/strong><\/h2>\n<p>df[&#39;column_name&#39;].plot(kind=&#39;line&#39;)<\/p>\n<p>plt.xlabel(&#39;Index&#39;)<\/p>\n<p>plt.ylabel(&#39;Value&#39;)<\/p>\n<p>plt.title(&#39;Financial Data&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86Pandas\u548cMatplotlib\u5e93\uff0c\u7136\u540e\u4f7f\u7528Pandas\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u8d22\u52a1\u6570\u636e\uff0c\u5e76\u663e\u793a\u6570\u636e\u6846\u7684\u524d\u51e0\u884c\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528\u6570\u636e\u6846\u7684\u65b9\u6cd5<code>plot()<\/code>\u7ed8\u5236\u56fe\u8868\uff0c\u5e76\u4f7f\u7528Matplotlib\u8bbe\u7f6e\u56fe\u8868\u7684\u6807\u7b7e\u548c\u6807\u9898\u3002\u6700\u540e\uff0c\u4f7f\u7528<code>plt.show()<\/code>\u51fd\u6570\u663e\u793a\u56fe\u8868\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u5c06\u4f1a\u5f39\u51fa\u4e00\u4e2a\u7a97\u53e3\u663e\u793a\u6298\u7ebf\u56fe\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001<strong>\u4f7f\u7528Seaborn\u5e93\u663e\u793a\u6570\u503c<\/strong><\/p>\n<\/p>\n<p><p>Seaborn\u662f\u57fa\u4e8eMatplotlib\u7684\u9ad8\u7ea7\u7ed8\u56fe\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u52a0\u7f8e\u89c2\u548c\u6613\u4e8e\u4f7f\u7528\u7684\u63a5\u53e3\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Seaborn\u5e93\u663e\u793a\u6570\u503c\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import seaborn as sns<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e<\/strong><\/h2>\n<p>df = pd.read_csv(&#39;financial_data.csv&#39;)<\/p>\n<h2><strong>\u663e\u793a\u6570\u636e\u6846\u7684\u524d\u51e0\u884c<\/strong><\/h2>\n<p>print(df.head())<\/p>\n<h2><strong>\u4f7f\u7528Seaborn\u7ed8\u5236\u7bb1\u7ebf\u56fe<\/strong><\/h2>\n<p>sns.boxplot(x=&#39;column_name&#39;, data=df)<\/p>\n<p>plt.xlabel(&#39;Value&#39;)<\/p>\n<p>plt.title(&#39;Financial Data&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86Pandas\u3001Seaborn\u548cMatplotlib\u5e93\uff0c\u7136\u540e\u4f7f\u7528Pandas\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u8d22\u52a1\u6570\u636e\uff0c\u5e76\u663e\u793a\u6570\u636e\u6846\u7684\u524d\u51e0\u884c\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528Seaborn\u7684<code>boxplot()<\/code>\u51fd\u6570\u7ed8\u5236\u7bb1\u7ebf\u56fe\uff0c\u5e76\u4f7f\u7528Matplotlib\u8bbe\u7f6e\u56fe\u8868\u7684\u6807\u7b7e\u548c\u6807\u9898\u3002\u6700\u540e\uff0c\u4f7f\u7528<code>plt.show()<\/code>\u51fd\u6570\u663e\u793a\u56fe\u8868\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u5c06\u4f1a\u5f39\u51fa\u4e00\u4e2a\u7a97\u53e3\u663e\u793a\u7bb1\u7ebf\u56fe\u3002<\/p>\n<\/p>\n<p><p>\u516b\u3001<strong>\u4f7f\u7528NumPy\u5e93\u5904\u7406\u6570\u503c<\/strong><\/p>\n<\/p>\n<p><p>NumPy\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u503c\u8ba1\u7b97\u5e93\uff0c\u63d0\u4f9b\u4e86\u591a\u7ef4\u6570\u7ec4\u5bf9\u8c61\u548c\u4e30\u5bcc\u7684\u6570\u503c\u8ba1\u7b97\u51fd\u6570\u3002\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cNumPy\u7ecf\u5e38\u88ab\u7528\u6765\u5904\u7406\u6570\u503c\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528NumPy\u5e93\u5904\u7406\u6570\u503c\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u4e00\u4e2a\u6570\u503c\u6570\u7ec4<\/strong><\/h2>\n<p>values = np.array([100, 200, 300, 400, 500])<\/p>\n<h2><strong>\u8ba1\u7b97\u6570\u7ec4\u7684\u5747\u503c<\/strong><\/h2>\n<p>mean_value = np.mean(values)<\/p>\n<p>print(&quot;Mean value:&quot;, mean_value)<\/p>\n<h2><strong>\u8ba1\u7b97\u6570\u7ec4\u7684\u6807\u51c6\u5dee<\/strong><\/h2>\n<p>std_value = np.std(values)<\/p>\n<p>print(&quot;Standard deviation:&quot;, std_value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86NumPy\u5e93\uff0c\u7136\u540e\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6570\u503c\u6570\u7ec4<code>values<\/code>\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528NumPy\u7684<code>mean()<\/code>\u51fd\u6570\u8ba1\u7b97\u6570\u7ec4\u7684\u5747\u503c\uff0c\u5e76\u4f7f\u7528<code>std()<\/code>\u51fd\u6570\u8ba1\u7b97\u6570\u7ec4\u7684\u6807\u51c6\u5dee\u3002\u6700\u540e\uff0c\u4f7f\u7528<code>print()<\/code>\u51fd\u6570\u663e\u793a\u8ba1\u7b97\u7ed3\u679c\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u63a7\u5236\u53f0\u5c06\u663e\u793a<code>Mean value: 300.0<\/code>\u548c<code>Standard deviation: 141.4213562373095<\/code>\u3002<\/p>\n<\/p>\n<p><p>\u4e5d\u3001<strong>\u4f7f\u7528SciPy\u5e93\u8fdb\u884c\u7edf\u8ba1\u5206\u6790<\/strong><\/p>\n<\/p>\n<p><p>SciPy\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u7edf\u8ba1\u5206\u6790\u51fd\u6570\u3002\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cSciPy\u7ecf\u5e38\u88ab\u7528\u6765\u8fdb\u884c\u7edf\u8ba1\u5206\u6790\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528SciPy\u5e93\u8fdb\u884c\u7edf\u8ba1\u5206\u6790\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>from scipy import stats<\/p>\n<h2><strong>\u5b9a\u4e49\u4e00\u4e2a\u6570\u503c\u6570\u7ec4<\/strong><\/h2>\n<p>values = np.array([100, 200, 300, 400, 500])<\/p>\n<h2><strong>\u8fdb\u884ct\u68c0\u9a8c<\/strong><\/h2>\n<p>t_stat, p_value = stats.ttest_1samp(values, 250)<\/p>\n<p>print(&quot;t-statistic:&quot;, t_stat)<\/p>\n<p>print(&quot;p-value:&quot;, p_value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86NumPy\u548cSciPy\u5e93\uff0c\u7136\u540e\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6570\u503c\u6570\u7ec4<code>values<\/code>\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528SciPy\u7684<code>ttest_1samp()<\/code>\u51fd\u6570\u8fdb\u884c\u5355\u6837\u672ct\u68c0\u9a8c\uff0c\u5e76\u663e\u793at\u7edf\u8ba1\u91cf\u548cp\u503c\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u63a7\u5236\u53f0\u5c06\u663e\u793a<code>t-statistic: 0.7071067811865475<\/code>\u548c<code>p-value: 0.5235224328949254<\/code>\u3002<\/p>\n<\/p>\n<p><p>\u5341\u3001<strong>\u4f7f\u7528Statsmodels\u5e93\u8fdb\u884c\u56de\u5f52\u5206\u6790<\/strong><\/p>\n<\/p>\n<p><p>Statsmodels\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7edf\u8ba1\u5efa\u6a21\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u56de\u5f52\u5206\u6790\u51fd\u6570\u3002\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cStatsmodels\u7ecf\u5e38\u88ab\u7528\u6765\u8fdb\u884c\u56de\u5f52\u5206\u6790\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Statsmodels\u5e93\u8fdb\u884c\u56de\u5f52\u5206\u6790\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import statsmodels.api as sm<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e<\/strong><\/h2>\n<p>df = pd.read_csv(&#39;financial_data.csv&#39;)<\/p>\n<h2><strong>\u5b9a\u4e49\u81ea\u53d8\u91cf\u548c\u56e0\u53d8\u91cf<\/strong><\/h2>\n<p>X = df[[&#39;column1&#39;, &#39;column2&#39;]]<\/p>\n<p>y = df[&#39;target&#39;]<\/p>\n<h2><strong>\u6dfb\u52a0\u5e38\u6570\u9879<\/strong><\/h2>\n<p>X = sm.add_constant(X)<\/p>\n<h2><strong>\u8fdb\u884c\u7ebf\u6027\u56de\u5f52<\/strong><\/h2>\n<p>model = sm.OLS(y, X).fit()<\/p>\n<h2><strong>\u663e\u793a\u56de\u5f52\u7ed3\u679c<\/strong><\/h2>\n<p>print(model.summary())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86Pandas\u548cStatsmodels\u5e93\uff0c\u7136\u540e\u4f7f\u7528Pandas\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u8d22\u52a1\u6570\u636e\uff0c\u5e76\u5b9a\u4e49\u81ea\u53d8\u91cf<code>X<\/code>\u548c\u56e0\u53d8\u91cf<code>y<\/code>\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528Statsmodels\u7684<code>add_constant()<\/code>\u51fd\u6570\u6dfb\u52a0\u5e38\u6570\u9879\uff0c\u5e76\u4f7f\u7528<code>OLS()<\/code>\u51fd\u6570\u8fdb\u884c\u7ebf\u6027\u56de\u5f52\u3002\u6700\u540e\uff0c\u4f7f\u7528<code>summary()<\/code>\u65b9\u6cd5\u663e\u793a\u56de\u5f52\u7ed3\u679c\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u63a7\u5236\u53f0\u5c06\u663e\u793a\u56de\u5f52\u5206\u6790\u7684\u8be6\u7ec6\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><p>\u5341\u4e00\u3001<strong>\u4f7f\u7528Scikit-learn\u5e93\u8fdb\u884c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a><\/strong><\/p>\n<\/p>\n<p><p>Scikit-learn\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u673a\u5668\u5b66\u4e60\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u3002\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cScikit-learn\u7ecf\u5e38\u88ab\u7528\u6765\u8fdb\u884c\u673a\u5668\u5b66\u4e60\u5efa\u6a21\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Scikit-learn\u5e93\u8fdb\u884c\u7ebf\u6027\u56de\u5f52\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>from sklearn.model_selection import tr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n_test_split<\/p>\n<p>from sklearn.linear_model import LinearRegression<\/p>\n<p>from sklearn.metrics import mean_squared_error<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e<\/strong><\/h2>\n<p>df = pd.read_csv(&#39;financial_data.csv&#39;)<\/p>\n<h2><strong>\u5b9a\u4e49\u81ea\u53d8\u91cf\u548c\u56e0\u53d8\u91cf<\/strong><\/h2>\n<p>X = df[[&#39;column1&#39;, &#39;column2&#39;]]<\/p>\n<p>y = df[&#39;target&#39;]<\/p>\n<h2><strong>\u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6<\/strong><\/h2>\n<p>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<\/p>\n<h2><strong>\u521b\u5efa\u7ebf\u6027\u56de\u5f52\u6a21\u578b<\/strong><\/h2>\n<p>model = LinearRegression()<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>model.fit(X_train, y_train)<\/p>\n<h2><strong>\u9884\u6d4b\u6d4b\u8bd5\u96c6<\/strong><\/h2>\n<p>y_pred = model.predict(X_test)<\/p>\n<h2><strong>\u8ba1\u7b97\u5747\u65b9\u8bef\u5dee<\/strong><\/h2>\n<p>mse = mean_squared_error(y_test, y_pred)<\/p>\n<p>print(&quot;Mean Squared Error:&quot;, mse)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86Pandas\u548cScikit-learn\u5e93\uff0c\u7136\u540e\u4f7f\u7528Pandas\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u8d22\u52a1\u6570\u636e\uff0c\u5e76\u5b9a\u4e49\u81ea\u53d8\u91cf<code>X<\/code>\u548c\u56e0\u53d8\u91cf<code>y<\/code>\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528Scikit-learn\u7684<code>train_test_split()<\/code>\u51fd\u6570\u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\uff0c\u5e76\u521b\u5efa\u7ebf\u6027\u56de\u5f52\u6a21\u578b\u3002\u7136\u540e\uff0c\u6211\u4eec\u4f7f\u7528<code>fit()<\/code>\u65b9\u6cd5\u8bad\u7ec3\u6a21\u578b\uff0c\u5e76\u4f7f\u7528<code>predict()<\/code>\u65b9\u6cd5\u9884\u6d4b\u6d4b\u8bd5\u96c6\u3002\u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528<code>mean_squared_error()<\/code>\u51fd\u6570\u8ba1\u7b97\u5747\u65b9\u8bef\u5dee\uff0c\u5e76\u663e\u793a\u7ed3\u679c\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u63a7\u5236\u53f0\u5c06\u663e\u793a<code>Mean Squared Error<\/code>\u7684\u503c\u3002<\/p>\n<\/p>\n<p><p>\u5341\u4e8c\u3001<strong>\u4f7f\u7528TensorFlow\u5e93\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60<\/strong><\/p>\n<\/p>\n<p><p>TensorFlow\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6df1\u5ea6\u5b66\u4e60\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6df1\u5ea6\u5b66\u4e60\u7b97\u6cd5\u3002\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cTensorFlow\u7ecf\u5e38\u88ab\u7528\u6765\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60\u5efa\u6a21\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528TensorFlow\u5e93\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import tensorflow as tf<\/p>\n<p>from sklearn.model_selection import train_test_split<\/p>\n<p>from sklearn.preprocessing import StandardScaler<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e<\/strong><\/h2>\n<p>df = pd.read_csv(&#39;financial_data.csv&#39;)<\/p>\n<h2><strong>\u5b9a\u4e49\u81ea\u53d8\u91cf\u548c\u56e0\u53d8\u91cf<\/strong><\/h2>\n<p>X = df[[&#39;column1&#39;, &#39;column2&#39;]]<\/p>\n<p>y = df[&#39;target&#39;]<\/p>\n<h2><strong>\u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6<\/strong><\/h2>\n<p>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)<\/p>\n<h2><strong>\u6807\u51c6\u5316\u6570\u636e<\/strong><\/h2>\n<p>scaler = StandardScaler()<\/p>\n<p>X_train = scaler.fit_transform(X_train)<\/p>\n<p>X_test = scaler.transform(X_test)<\/p>\n<h2><strong>\u521b\u5efa\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b<\/strong><\/h2>\n<p>model = tf.keras.Sequential([<\/p>\n<p>    tf.keras.layers.Dense(64, activation=&#39;relu&#39;, input_shape=(X_train.shape[1],)),<\/p>\n<p>    tf.keras.layers.Dense(32, activation=&#39;relu&#39;),<\/p>\n<p>    tf.keras.layers.Dense(1)<\/p>\n<p>])<\/p>\n<h2><strong>\u7f16\u8bd1\u6a21\u578b<\/strong><\/h2>\n<p>model.compile(optimizer=&#39;adam&#39;, loss=&#39;mse&#39;)<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>model.fit(X_train, y_train, epochs=100, batch_size=32, validation_split=0.2)<\/p>\n<h2><strong>\u9884\u6d4b\u6d4b\u8bd5\u96c6<\/strong><\/h2>\n<p>y_pred = model.predict(X_test)<\/p>\n<h2><strong>\u8ba1\u7b97\u5747\u65b9\u8bef\u5dee<\/strong><\/h2>\n<p>mse = tf.keras.losses.MeanSquaredError()(y_test, y_pred).numpy()<\/p>\n<p>print(&quot;Mean Squared Error:&quot;, mse)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u5bfc\u5165\u4e86Pandas\u3001TensorFlow\u548cScikit-learn\u5e93\uff0c\u7136\u540e\u4f7f\u7528Pandas\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u8d22\u52a1\u6570\u636e\uff0c\u5e76\u5b9a\u4e49\u81ea\u53d8\u91cf<code>X<\/code>\u548c\u56e0\u53d8\u91cf<code>y<\/code>\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528Scikit-learn\u7684<code>train_test_split()<\/code>\u51fd\u6570\u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\uff0c\u5e76\u4f7f\u7528<code>StandardScaler<\/code>\u8fdb\u884c\u6570\u636e\u6807\u51c6\u5316\u3002\u7136\u540e\uff0c\u6211\u4eec\u4f7f\u7528TensorFlow\u7684<code>Sequential<\/code>\u6a21\u578b\u521b\u5efa\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\uff0c\u5e76\u4f7f\u7528<code>compile()<\/code>\u65b9\u6cd5\u7f16\u8bd1\u6a21\u578b\u3002\u63a5\u7740\uff0c\u6211\u4eec\u4f7f\u7528<code>fit()<\/code>\u65b9\u6cd5\u8bad\u7ec3\u6a21\u578b\uff0c\u5e76\u4f7f\u7528<code>predict()<\/code>\u65b9\u6cd5\u9884\u6d4b\u6d4b\u8bd5\u96c6\u3002\u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528<code>MeanSquaredError()<\/code>\u51fd\u6570\u8ba1\u7b97\u5747\u65b9\u8bef\u5dee\uff0c\u5e76\u663e\u793a\u7ed3\u679c\u3002\u8fd0\u884c\u4ee3\u7801\u540e\uff0c\u63a7\u5236\u53f0\u5c06\u663e\u793a<code>Mean Squared Error<\/code>\u7684\u503c\u3002<\/p>\n<\/p>\n<p><p>\u7efc\u4e0a\u6240\u8ff0\uff0cPython\u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\u63d0\u4f9b\u4e86\u591a\u79cd\u663e\u793a\u6570\u503c\u7684\u65b9\u6cd5\uff0c\u5305\u62ecprint()\u51fd\u6570\u3001\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3001Pandas\u5e93\u3001Matplotlib\u5e93\u3001Seaborn\u5e93\u3001NumPy\u5e93\u3001SciPy\u5e93\u3001Statsmodels\u5e93\u3001Scikit-learn\u5e93\u548cTensorFlow\u5e93\u7b49\u3002\u8fd9\u4e9b\u65b9\u6cd5\u5404\u6709\u4f18\u7f3a\u70b9\uff0c\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u573a\u666f\u3002\u901a\u8fc7\u5408\u7406\u9009\u62e9\u548c\u7ec4\u5408\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u8fdb\u884c\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\uff0c\u63d0\u5347\u5206\u6790\u6548\u7387\u548c\u6548\u679c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5904\u7406\u8d22\u52a1\u5927\u6570\u636e\uff1f<\/strong><br \/>\u5728Python\u4e2d\u5904\u7406\u8d22\u52a1\u5927\u6570\u636e\u901a\u5e38\u9700\u8981\u4f7f\u7528\u4e00\u4e9b\u5f3a\u5927\u7684\u5e93\uff0c\u5982Pandas\u548cNumPy\u3002Pandas\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u548c\u6570\u636e\u5206\u6790\u5de5\u5177\uff0c\u9002\u5408\u5904\u7406\u8868\u683c\u6570\u636e\u3002\u901a\u8fc7\u4f7f\u7528DataFrame\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u5bfc\u5165\u3001\u6e05\u6d17\u548c\u5206\u6790\u8d22\u52a1\u6570\u636e\uff0c\u8fdb\u884c\u5404\u79cd\u8ba1\u7b97\u548c\u53ef\u89c6\u5316\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u663e\u793a\u6570\u503c\u65f6\uff0c\u6709\u54ea\u4e9b\u5e38\u89c1\u7684\u683c\u5f0f\u5316\u65b9\u6cd5\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u6216f-string\u6765\u63a7\u5236\u6570\u503c\u7684\u663e\u793a\u683c\u5f0f\u3002\u6bd4\u5982\uff0c\u4f7f\u7528<code>&quot;{:.2f}&quot;.format(value)<\/code>\u6216<code>f&quot;{value:.2f}&quot;<\/code>\u53ef\u4ee5\u5c06\u6570\u503c\u683c\u5f0f\u5316\u4e3a\u4e24\u4f4d\u5c0f\u6570\u3002\u6b64\u5916\uff0c\u4f7f\u7528Pandas\u65f6\uff0cDataFrame\u7684<code>style.format()<\/code>\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u663e\u793a\u683c\u5f0f\uff0c\u65b9\u4fbf\u5c55\u793a\u8d22\u52a1\u6570\u636e\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528Python\u751f\u6210\u8d22\u52a1\u6570\u636e\u7684\u53ef\u89c6\u5316\u56fe\u8868\uff1f<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u591a\u4e2a\u5e93\u6765\u751f\u6210\u6570\u636e\u53ef\u89c6\u5316\u56fe\u8868\uff0cMatplotlib\u548cSeaborn\u662f\u6700\u5e38\u7528\u7684\u3002\u901a\u8fc7\u8fd9\u4e9b\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u6298\u7ebf\u56fe\u3001\u67f1\u72b6\u56fe\u548c\u997c\u56fe\u7b49\uff0c\u5e2e\u52a9\u7528\u6237\u66f4\u76f4\u89c2\u5730\u7406\u89e3\u8d22\u52a1\u6570\u636e\u53d8\u5316\u548c\u8d8b\u52bf\u3002\u7ed3\u5408Pandas\uff0c\u53ef\u4ee5\u76f4\u63a5\u4eceDataFrame\u4e2d\u7ed8\u56fe\uff0c\u7b80\u5316\u4e86\u6570\u636e\u5904\u7406\u548c\u53ef\u89c6\u5316\u7684\u8fc7\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001\u8d22\u52a1\u5927\u6570\u636ePython\u57fa\u7840\u663e\u793a\u6570\u503c\u7684\u65b9\u6cd5 \u5728\u8d22\u52a1\u5927\u6570\u636e\u5206\u6790\u4e2d\uff0cPython\u662f\u4e00\u79cd\u975e\u5e38\u5f3a\u5927\u7684\u5de5\u5177\u3002\u8981\u5728Pyt [&hellip;]","protected":false},"author":3,"featured_media":1070875,"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\/1070862"}],"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=1070862"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1070862\/revisions"}],"predecessor-version":[{"id":1070879,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1070862\/revisions\/1070879"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1070875"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1070862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1070862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1070862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}