{"id":985795,"date":"2024-12-27T07:39:40","date_gmt":"2024-12-26T23:39:40","guid":{"rendered":""},"modified":"2024-12-27T07:39:42","modified_gmt":"2024-12-26T23:39:42","slug":"python%e5%a6%82%e4%bd%95%e8%ae%a9%e8%a1%8c%e5%88%97%e5%af%b9%e9%bd%90","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/985795.html","title":{"rendered":"python\u5982\u4f55\u8ba9\u884c\u5217\u5bf9\u9f50"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25062658\/978eeef9-48f6-4f69-9bad-386eb5a5b13c.webp\" alt=\"python\u5982\u4f55\u8ba9\u884c\u5217\u5bf9\u9f50\" \/><\/p>\n<p><p> \u4e00\u3001Python\u4e2d\u884c\u5217\u5bf9\u9f50\u7684\u65b9\u6cd5  <\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u5b9e\u73b0\u884c\u5217\u5bf9\u9f50\u7684\u65b9\u6cd5\u4e3b\u8981\u6709<strong>\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3001\u4f7f\u7528pandas\u5e93\u3001\u4f7f\u7528tabulate\u5e93<\/strong>\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u662f\u4e00\u79cd\u57fa\u672c\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u5b57\u7b26\u4e32\u7684\u5bbd\u5ea6\u6765\u5b9e\u73b0\u5bf9\u9f50\uff1b\u800cpandas\u5e93\u548ctabulate\u5e93\u63d0\u4f9b\u4e86\u66f4\u4e3a\u5f3a\u5927\u7684\u8868\u683c\u5904\u7406\u529f\u80fd\uff0c\u80fd\u591f\u8f7b\u677e\u5730\u5b9e\u73b0\u6570\u636e\u7684\u884c\u5217\u5bf9\u9f50\u3002\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u662f\u6700\u57fa\u7840\u7684\u65b9\u6cd5\uff0c\u901a\u5e38\u901a\u8fc7<code>str.format()<\/code>\u6216f-string\u6765\u5b9e\u73b0\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c\u901a\u8fc7\u6307\u5b9a\u5b57\u6bb5\u5bbd\u5ea6\uff0c\u53ef\u4ee5\u8ba9\u8f93\u51fa\u7684\u5217\u5bf9\u9f50\u3002  <\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u5bbd\u5ea6\u6765\u5b9e\u73b0\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c<code>&quot;{:&lt;10}&quot;.format(value)<\/code>\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u5de6\u5bf9\u9f50\u5e76\u5360\u752810\u4e2a\u5b57\u7b26\u5bbd\u5ea6\u3002f-string\u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u7b80\u6d01\u7684\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\uff0c\u8bed\u6cd5\u4e3a<code>f&quot;{value:&lt;10}&quot;<\/code>\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u7b80\u5355\u7684\u5bf9\u9f50\u9700\u6c42\uff0c\u5bf9\u4e8e\u8f83\u590d\u6742\u7684\u8868\u683c\u6570\u636e\u5904\u7406\uff0c\u5efa\u8bae\u4f7f\u7528pandas\u6216tabulate\u5e93\u3002  <\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316  <\/p>\n<\/p>\n<p><p>\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u662fPython\u4e2d\u6700\u57fa\u7840\u7684\u5bf9\u9f50\u65b9\u6cd5\uff0c\u5229\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\uff0c\u6211\u4eec\u53ef\u4ee5\u6307\u5b9a\u8f93\u51fa\u7684\u5bbd\u5ea6\u548c\u5bf9\u9f50\u65b9\u5f0f\u3002  <\/p>\n<\/p>\n<ol>\n<li><strong>\u57fa\u672c\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316<\/strong><\/li>\n<\/ol>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\u767e\u5206\u53f7\u683c\u5f0f\u5316\u3001str.format()\u65b9\u6cd5\u548cf-strings\u3002\u767e\u5206\u53f7\u683c\u5f0f\u5316\u662fPython\u65e9\u671f\u7248\u672c\u4e2d\u63d0\u4f9b\u7684\u65b9\u6cd5\uff0c\u800cstr.format()\u548cf-strings\u662f\u8f83\u65b0\u7684\u65b9\u6cd5\uff0c\u540e\u8005\u5728Python 3.6\u4e2d\u5f15\u5165\u3002  <\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u767e\u5206\u53f7\u683c\u5f0f\u5316<\/strong><\/li>\n<\/ol>\n<p><p>\u767e\u5206\u53f7\u683c\u5f0f\u5316\u662f\u4f7f\u7528%\u64cd\u4f5c\u7b26\u6765\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u3002\u901a\u8fc7\u5728\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u5bbd\u5ea6\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c<code>&quot;%10s&quot; % value<\/code>\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u53f3\u5bf9\u9f50\u5e76\u5360\u752810\u4e2a\u5b57\u7b26\u5bbd\u5ea6\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">value = &quot;Python&quot;  <\/p>\n<p>print(&quot;%10s&quot; % value)  # \u8f93\u51fa\u7ed3\u679c\u4e3a: &#39;    Python&#39;  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>str.format()\u65b9\u6cd5<\/strong><\/li>\n<\/ol>\n<p><p>str.format()\u65b9\u6cd5\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7075\u6d3b\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u529f\u80fd\u3002\u901a\u8fc7\u5728\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u4e2d\u4f7f\u7528\u82b1\u62ec\u53f7{}\u5360\u4f4d\u7b26\uff0c\u5e76\u901a\u8fc7\u6307\u5b9a\u683c\u5f0f\u5316\u9009\u9879\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c<code>&quot;{:&lt;10}&quot;.format(value)<\/code>\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u5de6\u5bf9\u9f50\u5e76\u5360\u752810\u4e2a\u5b57\u7b26\u5bbd\u5ea6\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">value = &quot;Python&quot;  <\/p>\n<p>print(&quot;{:&lt;10}&quot;.format(value))  # \u8f93\u51fa\u7ed3\u679c\u4e3a: &#39;Python    &#39;  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li><strong>f-strings<\/strong><\/li>\n<\/ol>\n<p><p>f-strings\u662fPython 3.6\u5f15\u5165\u7684\u4e00\u79cd\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u7684\u8bed\u6cd5\uff0c\u4f7f\u7528f\u5f00\u5934\u7684\u5b57\u7b26\u4e32\uff0c\u5e76\u5728\u82b1\u62ec\u53f7{}\u4e2d\u76f4\u63a5\u5d4c\u5165\u53d8\u91cf\u6216\u8868\u8fbe\u5f0f\u3002\u4e0estr.format()\u65b9\u6cd5\u7c7b\u4f3c\uff0cf-strings\u4e5f\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9a\u5bbd\u5ea6\u6765\u5b9e\u73b0\u5bf9\u9f50\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">value = &quot;Python&quot;  <\/p>\n<p>print(f&quot;{value:&gt;10}&quot;)  # \u8f93\u51fa\u7ed3\u679c\u4e3a: &#39;    Python&#39;  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528pandas\u5e93  <\/p>\n<\/p>\n<p><p>pandas\u662fPython\u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u5e93\uff0c\u63d0\u4f9b\u4e86DataFrame\u548cSeries\u4e24\u79cd\u57fa\u672c\u6570\u636e\u7ed3\u6784\u3002\u5229\u7528pandas\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u65b9\u4fbf\u5730\u5904\u7406\u8868\u683c\u6570\u636e\uff0c\u5e76\u5b9e\u73b0\u884c\u5217\u5bf9\u9f50\u3002  <\/p>\n<\/p>\n<ol>\n<li><strong>\u521b\u5efaDataFrame<\/strong><\/li>\n<\/ol>\n<p><p>DataFrame\u662fpandas\u5e93\u4e2d\u7528\u4e8e\u5b58\u50a8\u8868\u683c\u6570\u636e\u7684\u6838\u5fc3\u6570\u636e\u7ed3\u6784\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u521b\u5efaDataFrame\uff0c\u5305\u62ec\u4ece\u5b57\u5178\u3001\u5217\u8868\u3001CSV\u6587\u4ef6\u7b49\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd  <\/p>\n<p>data = {&#39;Name&#39;: [&#39;Alice&#39;, &#39;Bob&#39;, &#39;Charlie&#39;], &#39;Age&#39;: [25, 30, 35]}  <\/p>\n<p>df = pd.DataFrame(data)  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5bf9\u9f50DataFrame<\/strong><\/li>\n<\/ol>\n<p><p>pandas\u5e93\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u5bf9DataFrame\u8fdb\u884c\u5bf9\u9f50\uff0c\u5305\u62ec\u8c03\u6574\u5217\u5bbd\u3001\u884c\u9ad8\u3001\u8bbe\u7f6e\u5bf9\u9f50\u65b9\u5f0f\u7b49\u3002\u901a\u8fc7\u8c03\u7528DataFrame\u5bf9\u8c61\u7684style\u5c5e\u6027\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u8868\u683c\u7684\u6837\u5f0f\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8bbe\u7f6e\u5217\u5bbd  <\/p>\n<p>df.style.set_properties(subset=[&#39;Name&#39;], {&#39;width&#39;: &#39;100px&#39;})  <\/p>\n<h2><strong>\u8bbe\u7f6e\u5bf9\u9f50\u65b9\u5f0f  <\/strong><\/h2>\n<p>df.style.set_properties(subset=[&#39;Name&#39;], {&#39;text-align&#39;: &#39;left&#39;})  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u8f93\u51fa\u5bf9\u9f50\u7684DataFrame<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528pandas\u5e93\uff0c\u53ef\u4ee5\u5c06\u5bf9\u9f50\u540e\u7684DataFrame\u8f93\u51fa\u4e3a\u591a\u79cd\u683c\u5f0f\uff0c\u5305\u62ecCSV\u3001Excel\u3001HTML\u7b49\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8f93\u51fa\u4e3aCSV\u6587\u4ef6  <\/p>\n<p>df.to_csv(&#39;output.csv&#39;, index=False)  <\/p>\n<h2><strong>\u8f93\u51fa\u4e3aHTML\u6587\u4ef6  <\/strong><\/h2>\n<p>df.to_html(&#39;output.html&#39;, index=False)  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528tabulate\u5e93  <\/p>\n<\/p>\n<p><p>tabulate\u662f\u4e00\u4e2aPython\u5e93\uff0c\u7528\u4e8e\u7f8e\u89c2\u5730\u6253\u5370\u8868\u683c\u6570\u636e\u3002\u901a\u8fc7tabulate\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u5b9e\u73b0\u6570\u636e\u7684\u884c\u5217\u5bf9\u9f50\uff0c\u5e76\u652f\u6301\u591a\u79cd\u8f93\u51fa\u683c\u5f0f\u3002  <\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5tabulate\u5e93<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u4f7f\u7528tabulate\u5e93\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u5176\u5df2\u5b89\u88c5\u3002\u53ef\u4ee5\u901a\u8fc7pip\u547d\u4ee4\u6765\u5b89\u88c5\u8be5\u5e93\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install tabulate  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528tabulate\u5e93\u6253\u5370\u8868\u683c<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528tabulate\u5e93\uff0c\u53ef\u4ee5\u5c06\u5217\u8868\u3001\u5b57\u5178\u7b49\u6570\u636e\u7ed3\u6784\u8f6c\u6362\u4e3a\u7f8e\u89c2\u7684\u8868\u683c\uff0c\u5e76\u652f\u6301\u591a\u79cd\u5bf9\u9f50\u65b9\u5f0f\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from tabulate import tabulate  <\/p>\n<p>data = [[&#39;Alice&#39;, 25], [&#39;Bob&#39;, 30], [&#39;Charlie&#39;, 35]]  <\/p>\n<p>headers = [&#39;Name&#39;, &#39;Age&#39;]  <\/p>\n<p>table = tabulate(data, headers, tablefmt=&#39;grid&#39;, stralign=&#39;center&#39;)  <\/p>\n<p>print(table)  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u8bbe\u7f6e\u5bf9\u9f50\u65b9\u5f0f<\/strong><\/li>\n<\/ol>\n<p><p>tabulate\u5e93\u652f\u6301\u591a\u79cd\u5bf9\u9f50\u65b9\u5f0f\uff0c\u5305\u62ec\u5de6\u5bf9\u9f50\u3001\u53f3\u5bf9\u9f50\u548c\u5c45\u4e2d\u5bf9\u9f50\u3002\u53ef\u4ee5\u901a\u8fc7stralign\u548cnumalign\u53c2\u6570\u6765\u8bbe\u7f6e\u5b57\u7b26\u4e32\u548c\u6570\u5b57\u7684\u5bf9\u9f50\u65b9\u5f0f\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">table = tabulate(data, headers, tablefmt=&#39;grid&#39;, stralign=&#39;left&#39;, numalign=&#39;right&#39;)  <\/p>\n<p>print(table)  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u8f93\u51fa\u683c\u5f0f<\/strong><\/li>\n<\/ol>\n<p><p>tabulate\u5e93\u652f\u6301\u591a\u79cd\u8f93\u51fa\u683c\u5f0f\uff0c\u5305\u62ecpl<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n\u3001grid\u3001html\u3001latex\u7b49\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u9009\u62e9\u5408\u9002\u7684\u683c\u5f0f\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8f93\u51fa\u4e3aHTML\u683c\u5f0f  <\/p>\n<p>html_table = tabulate(data, headers, tablefmt=&#39;html&#39;)  <\/p>\n<p>print(html_table)  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u603b\u7ed3  <\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u5b9e\u73b0\u884c\u5217\u5bf9\u9f50\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3001pandas\u5e93\u548ctabulate\u5e93\u7b49\u3002\u5bf9\u4e8e\u7b80\u5355\u7684\u5bf9\u9f50\u9700\u6c42\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u7684\u65b9\u6cd5\uff1b\u5bf9\u4e8e\u590d\u6742\u7684\u8868\u683c\u6570\u636e\u5904\u7406\uff0c\u53ef\u4ee5\u4f7f\u7528pandas\u5e93\u548ctabulate\u5e93\u3002\u8fd9\u4e9b\u65b9\u6cd5\u5404\u6709\u4f18\u7f3a\u70b9\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u6548\u7387\u3002\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u76f8\u4fe1\u8bfb\u8005\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u6c42\u9009\u62e9\u9002\u5408\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u884c\u5217\u5bf9\u9f50\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u884c\u5217\u5bf9\u9f50\uff1f<\/strong><\/p>\n<p>\u5728Python\u4e2d\uff0c\u884c\u5217\u5bf9\u9f50\u901a\u5e38\u6d89\u53ca\u5230\u6570\u636e\u7684\u8f93\u51fa\u683c\u5f0f\u5316\u3002\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u53ef\u4ee5\u65b9\u4fbf\u5730\u8c03\u6574\u8f93\u51fa\uff0c\u4f7f\u5176\u6574\u9f50\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528<code>str.format()<\/code>\u65b9\u6cd5\u6216f-string\uff08Python 3.6\u53ca\u4ee5\u4e0a\u7248\u672c\uff09\u6765\u5b9e\u73b0\u3002<\/p>\n<p><strong>\u4f7f\u7528Pandas\u5e93\u5982\u4f55\u5bf9\u9f50\u6570\u636e\uff1f<\/strong><\/p>\n<p>Pandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u6570\u636e\u7684\u884c\u5217\u5bf9\u9f50\u3002\u5229\u7528<code>DataFrame<\/code>\u5bf9\u8c61\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u52a0\u8f7d\u548c\u5904\u7406\u6570\u636e\uff0c\u5e76\u901a\u8fc7\u8bbe\u7f6e<code>align()<\/code>\u65b9\u6cd5\u5b9e\u73b0\u884c\u5217\u7684\u5bf9\u9f50\u3002\u8fd9\u5bf9\u4e8e\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u975e\u5e38\u6709\u5e2e\u52a9\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u63a7\u5236\u53f0\u8f93\u51fa\u5bf9\u9f50\u7684\u6587\u672c\uff1f<\/strong><\/p>\n<p>\u5728\u63a7\u5236\u53f0\u8f93\u51fa\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u7684<code>ljust()<\/code>, <code>rjust()<\/code>\u548c<code>center()<\/code>\u65b9\u6cd5\u6765\u5b9e\u73b0\u6587\u672c\u7684\u5bf9\u9f50\u3002\u901a\u8fc7\u6307\u5b9a\u5bbd\u5ea6\uff0c\u53ef\u4ee5\u786e\u4fdd\u6bcf\u4e00\u884c\u7684\u6587\u672c\u90fd\u6309\u7167\u9884\u671f\u7684\u683c\u5f0f\u8fdb\u884c\u5bf9\u9f50\uff0c\u8fd9\u5728\u751f\u6210\u62a5\u544a\u6216\u65e5\u5fd7\u65f6\u7279\u522b\u6709\u7528\u3002<\/p>\n<p><strong>\u662f\u5426\u6709\u53ef\u89c6\u5316\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u5b9e\u73b0\u884c\u5217\u5bf9\u9f50\uff1f<\/strong><\/p>\n<p>\u662f\u7684\uff0c\u5f88\u591a\u6570\u636e\u53ef\u89c6\u5316\u5de5\u5177\uff08\u5982Matplotlib\u548cSeaborn\uff09\u53ef\u4ee5\u5728\u56fe\u8868\u4e2d\u5b9e\u73b0\u884c\u5217\u7684\u5bf9\u9f50\u3002\u5728\u751f\u6210\u56fe\u8868\u65f6\uff0c\u6807\u7b7e\u548c\u56fe\u4f8b\u7684\u5bf9\u9f50\u4f1a\u5f71\u54cd\u89c6\u89c9\u6548\u679c\uff0c\u9002\u5f53\u7684\u683c\u5f0f\u5316\u548c\u5bf9\u9f50\u80fd\u591f\u63d0\u5347\u56fe\u8868\u7684\u53ef\u8bfb\u6027\u4e0e\u7f8e\u89c2\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001Python\u4e2d\u884c\u5217\u5bf9\u9f50\u7684\u65b9\u6cd5 \u5728Python\u4e2d\uff0c\u5b9e\u73b0\u884c\u5217\u5bf9\u9f50\u7684\u65b9\u6cd5\u4e3b\u8981\u6709\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3001\u4f7f\u7528pandas [&hellip;]","protected":false},"author":3,"featured_media":985801,"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\/985795"}],"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=985795"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/985795\/revisions"}],"predecessor-version":[{"id":985803,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/985795\/revisions\/985803"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/985801"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=985795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=985795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=985795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}