{"id":925897,"date":"2024-12-26T15:40:25","date_gmt":"2024-12-26T07:40:25","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/925897.html"},"modified":"2024-12-26T15:40:27","modified_gmt":"2024-12-26T07:40:27","slug":"python%e5%a6%82%e4%bd%95%e5%af%b9%e9%bd%90","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/925897.html","title":{"rendered":"python\u5982\u4f55\u5bf9\u9f50"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25062734\/54ecf498-7298-42cd-aa29-7a51e4d466f6.webp\" alt=\"python\u5982\u4f55\u5bf9\u9f50\" \/><\/p>\n<p><p> <strong>Python\u4e2d\u8fdb\u884c\u5bf9\u9f50\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3001\u6587\u672c\u5bf9\u9f50\u6a21\u5757textwrap\u3001NumPy\u5e93\u4e2d\u7684\u5bf9\u9f50\u529f\u80fd\u7b49\u3002\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u5b9e\u73b0\u5bf9\u9f50\uff0c\u5176\u4e2d\u5305\u62ec\u4f7f\u7528format()\u65b9\u6cd5\u3001f-string\u3001\u4ee5\u53ca\u4f20\u7edf\u7684\u767e\u5206\u53f7\u683c\u5f0f\u5316\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e76\u5bf9\u5176\u4e2d\u7684format()\u65b9\u6cd5\u8fdb\u884c\u8be6\u7ec6\u63cf\u8ff0\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u8fdb\u884c\u5bf9\u9f50\u662f\u4e00\u79cd\u7b80\u5355\u800c\u7075\u6d3b\u7684\u65b9\u6cd5\u3002Python\u63d0\u4f9b\u4e86\u591a\u79cd\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u5f0f\uff0c\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u6587\u672c\u5bf9\u9f50\u3002\u5bf9\u4e8eformat()\u65b9\u6cd5\uff0c\u901a\u8fc7\u6307\u5b9a\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u4e2d\u7684\u5bf9\u9f50\u5b57\u7b26\uff0c\u53ef\u4ee5\u8fdb\u884c\u5de6\u5bf9\u9f50\u3001\u53f3\u5bf9\u9f50\u548c\u5c45\u4e2d\u5bf9\u9f50\u7b49\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u4f7f\u7528&quot;:&lt;&quot;\u53ef\u4ee5\u5b9e\u73b0\u5de6\u5bf9\u9f50\uff0c&quot;:&gt;&quot;\u53ef\u4ee5\u5b9e\u73b0\u53f3\u5bf9\u9f50\uff0c\u800c&quot;:^&quot;\u5219\u7528\u4e8e\u5c45\u4e2d\u5bf9\u9f50\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u6307\u5b9a\u5bf9\u9f50\u7684\u5bbd\u5ea6\u548c\u586b\u5145\u5b57\u7b26\uff0c\u8fdb\u4e00\u6b65\u589e\u5f3a\u5bf9\u9f50\u6548\u679c\u3002<\/p>\n<\/p>\n<hr>\n<p><h2>\u4e00\u3001\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u6cd5<\/h2>\n<\/p>\n<p><h3>1.1 \u4f7f\u7528format()\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Python\u7684<code>format()<\/code>\u65b9\u6cd5\u662f\u8fdb\u884c\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u7684\u5e38\u7528\u5de5\u5177\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u57fa\u672c\u7684\u683c\u5f0f\u5316\uff0c\u8fd8\u80fd\u5b9e\u73b0\u7075\u6d3b\u7684\u5bf9\u9f50\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5de6\u5bf9\u9f50<\/strong>\uff1a\u901a\u8fc7\u5728\u683c\u5f0f\u8bf4\u660e\u7b26\u4e2d\u4f7f\u7528<code>:&lt;<\/code>\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5de6\u5bf9\u9f50\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&quot;{:&lt;10}&quot;.format(&quot;Python&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4ee5\u4e0a\u4ee3\u7801\u4f1a\u5c06\u5b57\u7b26\u4e32\u201cPython\u201d\u5de6\u5bf9\u9f50\uff0c\u5e76\u5728\u5176\u540e\u586b\u5145\u7a7a\u683c\u4ee5\u8fbe\u5230\u603b\u5bbd\u5ea610\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u53f3\u5bf9\u9f50<\/strong>\uff1a\u4f7f\u7528<code>:&gt;<\/code>\u53ef\u4ee5\u5b9e\u73b0\u53f3\u5bf9\u9f50\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&quot;{:&gt;10}&quot;.format(&quot;Python&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6bb5\u4ee3\u7801\u4f1a\u5c06\u5b57\u7b26\u4e32\u201cPython\u201d\u53f3\u5bf9\u9f50\uff0c\u5e76\u5728\u5176\u524d\u586b\u5145\u7a7a\u683c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5c45\u4e2d\u5bf9\u9f50<\/strong>\uff1a\u901a\u8fc7\u4f7f\u7528<code>:^<\/code>\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5c45\u4e2d\u5bf9\u9f50\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&quot;{:^10}&quot;.format(&quot;Python&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7ed3\u679c\u5c06\u4f1a\u662f\u5b57\u7b26\u4e32\u201cPython\u201d\u5c45\u4e2d\uff0c\u5e76\u5728\u4e24\u8fb9\u586b\u5145\u7a7a\u683c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><h3>1.2 f-string\u683c\u5f0f\u5316<\/h3>\n<\/p>\n<p><p>Python 3.6\u5f15\u5165\u4e86f-string\u683c\u5f0f\u5316\u65b9\u5f0f\uff0c\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u4ec5\u7b80\u6d01\u800c\u4e14\u9ad8\u6548\u3002\u5b83\u4e0e<code>format()<\/code>\u65b9\u6cd5\u7c7b\u4f3c\uff0c\u4e5f\u53ef\u4ee5\u8fdb\u884c\u5bf9\u9f50\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5de6\u5bf9\u9f50<\/strong>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">f&quot;{&#39;Python&#39;:&lt;10}&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u53f3\u5bf9\u9f50<\/strong>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">f&quot;{&#39;Python&#39;:&gt;10}&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5c45\u4e2d\u5bf9\u9f50<\/strong>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">f&quot;{&#39;Python&#39;:^10}&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><h3>1.3 \u767e\u5206\u53f7\u683c\u5f0f\u5316<\/h3>\n<\/p>\n<p><p>\u8fd9\u662fPython\u4e2d\u8f83\u65e9\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u65b9\u5f0f\uff0c\u867d\u7136\u4e0d\u5982<code>format()<\/code>\u548cf-string\u7075\u6d3b\uff0c\u4f46\u5728\u4e00\u4e9b\u7b80\u5355\u573a\u666f\u4e0b\u4f9d\u7136\u6709\u6548\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5de6\u5bf9\u9f50<\/strong>\uff1a\u53ef\u4ee5\u901a\u8fc7<code>%-s<\/code>\u5b9e\u73b0\u5de6\u5bf9\u9f50\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&quot;%-10s&quot; % &quot;Python&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u53f3\u5bf9\u9f50<\/strong>\uff1a\u4f7f\u7528<code>%s<\/code>\u53ef\u4ee5\u5b9e\u73b0\u9ed8\u8ba4\u7684\u53f3\u5bf9\u9f50\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&quot;%10s&quot; % &quot;Python&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<hr>\n<p><h2>\u4e8c\u3001\u4f7f\u7528textwrap\u6a21\u5757<\/h2>\n<\/p>\n<p><p>Python\u7684textwrap\u6a21\u5757\u4e13\u95e8\u7528\u4e8e\u6587\u672c\u5bf9\u9f50\u548c\u6362\u884c\u5904\u7406\uff0c\u5b83\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u5e2e\u52a9\u683c\u5f0f\u5316\u6587\u672c\u3002<\/p>\n<\/p>\n<p><h3>2.1 fill()\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p><code>fill()<\/code>\u65b9\u6cd5\u7528\u4e8e\u5c06\u6587\u672c\u5206\u5272\u6210\u591a\u4e2a\u884c\uff0c\u6bcf\u884c\u7684\u5bbd\u5ea6\u7531\u7528\u6237\u6307\u5b9a\u3002\u8fd9\u5728\u9700\u8981\u5bf9\u9f50\u591a\u884c\u6587\u672c\u65f6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import textwrap<\/p>\n<p>text = &quot;Python is an interpreted, high-level, and general-purpose programming language.&quot;<\/p>\n<p>wrapped_text = textwrap.fill(text, width=50)<\/p>\n<p>print(wrapped_text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2.2 dedent()\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p><code>dedent()<\/code>\u7528\u4e8e\u5220\u9664\u6587\u672c\u4e2d\u6bcf\u4e00\u884c\u7684\u524d\u5bfc\u7a7a\u683c\uff0c\u8fd9\u5728\u5904\u7406\u591a\u884c\u6587\u672c\u5bf9\u9f50\u65f6\u5c24\u5176\u6709\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;&quot;&quot;<\/p>\n<p>    Python is powerful...<\/p>\n<p>    and fast;<\/p>\n<p>    plays well with others;<\/p>\n<p>    runs everywhere;<\/p>\n<p>    is friendly &amp; easy to learn;<\/p>\n<p>    is Open.<\/p>\n<p>    &quot;&quot;&quot;<\/p>\n<p>dedented_text = textwrap.dedent(text)<\/p>\n<p>print(dedented_text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<hr>\n<p><h2>\u4e09\u3001NumPy\u5e93\u4e2d\u7684\u5bf9\u9f50\u529f\u80fd<\/h2>\n<\/p>\n<p><p>NumPy\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u5e93\uff0c\u4e5f\u63d0\u4f9b\u4e86\u591a\u79cd\u6570\u7ec4\u5bf9\u9f50\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>3.1 \u6570\u7ec4\u5bf9\u9f50<\/h3>\n<\/p>\n<p><p>\u5728\u79d1\u5b66\u8ba1\u7b97\u4e2d\uff0c\u5bf9\u9f50\u6570\u7ec4\u4ee5\u4fbf\u8fdb\u884c\u9ad8\u6548\u7684\u8ba1\u7b97\u975e\u5e38\u91cd\u8981\u3002NumPy\u7684<code>align<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u6765\u786e\u4fdd\u6570\u7ec4\u5728\u5185\u5b58\u4e2d\u7684\u5bf9\u9f50\uff0c\u4ee5\u63d0\u9ad8\u8ba1\u7b97\u6548\u7387\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>a = np.array([1, 2, 3, 4], dtype=np.float32)<\/p>\n<p>b = np.array([5, 6, 7, 8], dtype=np.float32)<\/p>\n<p>aligned_a, aligned_b = np.lib.stride_tricks.as_strided(a), np.lib.stride_tricks.as_strided(b)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3.2 \u4f7f\u7528structured arrays<\/h3>\n<\/p>\n<p><p>NumPy\u7684\u7ed3\u6784\u5316\u6570\u7ec4\u5141\u8bb8\u5bf9\u6570\u636e\u8fdb\u884c\u590d\u6742\u7684\u64cd\u4f5c\uff0c\u5305\u62ec\u5bf9\u9f50\u3002\u901a\u8fc7\u5b9a\u4e49\u7ed3\u6784\u5316\u6570\u636e\u7c7b\u578b\uff0c\u53ef\u4ee5\u5bf9\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u8fdb\u884c\u7cbe\u786e\u5bf9\u9f50\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">dtype = np.dtype([(&#39;x&#39;, np.int32), (&#39;y&#39;, np.float64)])<\/p>\n<p>data = np.array([(1, 2.0), (3, 4.0)], dtype=dtype)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<hr>\n<p><h2>\u56db\u3001Pandas\u5e93\u4e2d\u7684\u5bf9\u9f50<\/h2>\n<\/p>\n<p><p>Pandas\u662f\u7528\u4e8e\u6570\u636e\u5206\u6790\u7684\u5f3a\u5927\u5de5\u5177\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86DataFrame\u548cSeries\u5bf9\u8c61\u7684\u5bf9\u9f50\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h3>4.1 DataFrame\u7684\u5bf9\u9f50<\/h3>\n<\/p>\n<p><p>DataFrame\u662fPandas\u4e2d\u6700\u5e38\u7528\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\u3002\u901a\u8fc7\u5bf9\u884c\u548c\u5217\u8fdb\u884c\u5bf9\u9f50\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>df1 = pd.DataFrame({&#39;A&#39;: [1, 2], &#39;B&#39;: [3, 4]})<\/p>\n<p>df2 = pd.DataFrame({&#39;A&#39;: [5, 6], &#39;C&#39;: [7, 8]})<\/p>\n<p>aligned_df = df1.align(df2, join=&#39;outer&#39;, axis=1)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4.2 Series\u7684\u5bf9\u9f50<\/h3>\n<\/p>\n<p><p>Series\u662fPandas\u4e2d\u53e6\u4e00\u79cd\u91cd\u8981\u7684\u6570\u636e\u7ed3\u6784\uff0c\u53ef\u4ee5\u901a\u8fc7\u7d22\u5f15\u8fdb\u884c\u5bf9\u9f50\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">s1 = pd.Series([1, 2, 3], index=[&#39;a&#39;, &#39;b&#39;, &#39;c&#39;])<\/p>\n<p>s2 = pd.Series([4, 5, 6], index=[&#39;b&#39;, &#39;c&#39;, &#39;d&#39;])<\/p>\n<p>aligned_s1, aligned_s2 = s1.align(s2, join=&#39;outer&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<hr>\n<p><h2>\u4e94\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6587\u672c\u548c\u6570\u636e\u5bf9\u9f50\u662f\u4e00\u4e2a\u5e38\u89c1\u4e14\u91cd\u8981\u7684\u4efb\u52a1\u3002\u901a\u8fc7\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3001textwrap\u6a21\u5757\u3001NumPy\u548cPandas\u5e93\uff0c\u7528\u6237\u53ef\u4ee5\u9ad8\u6548\u5730\u5b9e\u73b0\u5bf9\u9f50\u64cd\u4f5c\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u72ec\u7279\u7684\u4f18\u52bf\u548c\u5e94\u7528\u573a\u666f\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002\u5728\u5904\u7406\u590d\u6742\u6570\u636e\u65f6\uff0c\u5c24\u5176\u662f\u5728\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u9886\u57df\uff0c\u9009\u62e9\u5408\u9002\u7684\u5bf9\u9f50\u65b9\u6cd5\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6548\u7387\u548c\u53ef\u8bfb\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>Python\u4e2d\u5982\u4f55\u5904\u7406\u6587\u672c\u5bf9\u9f50\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u7684\u683c\u5f0f\u5316\u65b9\u6cd5\u6765\u5904\u7406\u6587\u672c\u5bf9\u9f50\u3002\u5e38\u7528\u7684\u6709<code>str.ljust()<\/code>, <code>str.rjust()<\/code>, \u548c <code>str.center()<\/code>\u65b9\u6cd5\u3002<code>ljust()<\/code>\u7528\u4e8e\u5de6\u5bf9\u9f50\uff0c<code>rjust()<\/code>\u7528\u4e8e\u53f3\u5bf9\u9f50\uff0c\u800c<code>center()<\/code>\u5219\u7528\u4e8e\u5c45\u4e2d\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c<code>&quot;Hello&quot;.ljust(10)<\/code>\u4f1a\u8fd4\u56de<code>&#39;Hello     &#39;<\/code>\uff0c\u800c<code>&quot;Hello&quot;.center(10)<\/code>\u8fd4\u56de<code>&#39;  Hello   &#39;<\/code>\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5bf9\u9f50\u6570\u5b57\u8f93\u51fa\uff1f<\/strong><br \/>\u5bf9\u4e8e\u6570\u5b57\u7684\u5bf9\u9f50\uff0c\u53ef\u4ee5\u4f7f\u7528\u683c\u5f0f\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>f&quot;{value:&gt;10}&quot;<\/code>\u53ef\u4ee5\u5b9e\u73b0\u53f3\u5bf9\u9f50\uff0c<code>f&quot;{value:&lt;10}&quot;<\/code>\u7528\u4e8e\u5de6\u5bf9\u9f50\uff0c<code>f&quot;{value:^10}&quot;<\/code>\u5b9e\u73b0\u5c45\u4e2d\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u5728\u8f93\u51fa\u65f6\uff0c\u6570\u5b57\u6309\u5217\u5bf9\u9f50\uff0c\u4f7f\u5f97\u7ed3\u679c\u66f4\u52a0\u6574\u9f50\u6613\u8bfb\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u5bf9\u9f50\u5217\u8868\u6570\u636e\uff1f<\/strong><br \/>\u5bf9\u4e8e\u5217\u8868\u6570\u636e\u7684\u5bf9\u9f50\uff0c\u53ef\u4ee5\u901a\u8fc7\u5faa\u73af\u904d\u5386\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u8fdb\u884c\u5bf9\u9f50\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>format()<\/code>\u6216f-string\u53ef\u4ee5\u5728\u6253\u5370\u5217\u8868\u65f6\u5b9e\u73b0\u5bf9\u9f50\u6548\u679c\u3002\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u6700\u5927\u7684\u5217\u5bbd\uff0c\u786e\u4fdd\u6240\u6709\u5143\u7d20\u90fd\u6309\u7167\u8be5\u5217\u5bbd\u8fdb\u884c\u683c\u5f0f\u5316\uff0c\u4ece\u800c\u5b9e\u73b0\u6574\u9f50\u7684\u8f93\u51fa\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u4e2d\u8fdb\u884c\u5bf9\u9f50\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u3001\u6587\u672c\u5bf9\u9f50\u6a21\u5757textwrap\u3001NumPy\u5e93\u4e2d\u7684\u5bf9\u9f50\u529f [&hellip;]","protected":false},"author":3,"featured_media":925901,"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\/925897"}],"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=925897"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/925897\/revisions"}],"predecessor-version":[{"id":925902,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/925897\/revisions\/925902"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/925901"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=925897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=925897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=925897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}