{"id":957725,"date":"2024-12-27T03:07:11","date_gmt":"2024-12-26T19:07:11","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/957725.html"},"modified":"2024-12-27T03:07:15","modified_gmt":"2024-12-26T19:07:15","slug":"python%e4%b8%ad%e5%a6%82%e4%bd%95%e6%95%b0%e6%8d%ae%e6%9b%bf%e6%8d%a2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/957725.html","title":{"rendered":"python\u4e2d\u5982\u4f55\u6570\u636e\u66ff\u6362"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25100931\/f786be8c-fab2-4fc5-93c5-6bf69496ed43.webp\" alt=\"python\u4e2d\u5982\u4f55\u6570\u636e\u66ff\u6362\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u8fdb\u884c\u6570\u636e\u66ff\u6362\u7684\u5e38\u7528\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528\u5b57\u7b26\u4e32\u7684replace\u65b9\u6cd5\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u3001Pandas\u5e93\u7684replace\u65b9\u6cd5\u548cNumpy\u5e93\u7684where\u65b9\u6cd5\u7b49\u3002<strong>\u5b57\u7b26\u4e32\u7684replace\u65b9\u6cd5\u7528\u4e8e\u7b80\u5355\u7684\u5b57\u7b26\u66ff\u6362\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u4ee5\u5904\u7406\u66f4\u590d\u6742\u7684\u66ff\u6362\u64cd\u4f5c\u3001Pandas\u5e93\u7684replace\u65b9\u6cd5\u9002\u7528\u4e8e\u6570\u636e\u6846\u7684\u5143\u7d20\u7ea7\u66ff\u6362\u3001Numpy\u5e93\u7684where\u65b9\u6cd5\u5219\u7528\u4e8e\u6570\u7ec4\u4e2d\u57fa\u4e8e\u6761\u4ef6\u7684\u66ff\u6362<\/strong>\u3002\u5728\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\uff0c\u5b57\u7b26\u4e32\u7684replace\u65b9\u6cd5\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u6700\u5e38\u7528\u7684\u3002\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5b57\u7b26\u4e32\u7684replace\u65b9\u6cd5\u7684\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><p><strong>\u5b57\u7b26\u4e32\u7684replace\u65b9\u6cd5\u7528\u4e8e\u7b80\u5355\u7684\u5b57\u7b26\u66ff\u6362<\/strong>\u3002\u8be5\u65b9\u6cd5\u7528\u4e8e\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5b50\u5b57\u7b26\u4e32\uff0c\u8bed\u6cd5\u4e3a<code>str.replace(old, new[, count])<\/code>\uff0c\u5176\u4e2d<code>old<\/code>\u662f\u9700\u8981\u66ff\u6362\u7684\u5b50\u5b57\u7b26\u4e32\uff0c<code>new<\/code>\u662f\u66ff\u6362\u540e\u7684\u5b57\u7b26\u4e32\uff0c<code>count<\/code>\u662f\u53ef\u9009\u53c2\u6570\uff0c\u8868\u793a\u66ff\u6362\u7684\u6b21\u6570\u3002\u82e5\u4e0d\u6307\u5b9a<code>count<\/code>\uff0c\u5219\u4f1a\u66ff\u6362\u6240\u6709\u5339\u914d\u7684\u5b50\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff0c<code>s = &#39;hello world&#39;; s.replace(&#39;world&#39;, &#39;Python&#39;)<\/code>\u5c06\u8f93\u51fa<code>&#39;hello Python&#39;<\/code>\u3002\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u76f4\u89c2\u4e14\u6613\u4e8e\u4f7f\u7528\uff0c\u4f46\u53ea\u80fd\u5904\u7406\u5355\u4e00\u6a21\u5f0f\u7684\u66ff\u6362\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecdPython\u4e2d\u5176\u4ed6\u6570\u636e\u66ff\u6362\u65b9\u6cd5\u7684\u5e94\u7528\u53ca\u5176\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u66ff\u6362<\/h2>\n<\/p>\n<p><p>\u6b63\u5219\u8868\u8fbe\u5f0f\uff08Regular Expression\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u5339\u914d\u5b57\u7b26\u4e32\u4e2d\u5b57\u7b26\u7ec4\u5408\u7684\u6a21\u5f0f\u3002\u5728Python\u4e2d\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u7531<code>re<\/code>\u6a21\u5757\u63d0\u4f9b\u652f\u6301\u3002<code>re.sub()<\/code>\u51fd\u6570\u7528\u4e8e\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u6a21\u5f0f\uff0c\u8bed\u6cd5\u4e3a<code>re.sub(pattern, repl, string, count=0, flags=0)<\/code>\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>pattern<\/strong>\uff1a\u8fd9\u662f\u8981\u5339\u914d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u3002<\/li>\n<li><strong>repl<\/strong>\uff1a\u8fd9\u662f\u66ff\u6362\u7684\u5b57\u7b26\u4e32\uff0c\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u51fd\u6570\u3002<\/li>\n<li><strong>string<\/strong>\uff1a\u8fd9\u662f\u8981\u88ab\u5904\u7406\u7684\u5b57\u7b26\u4e32\u3002<\/li>\n<li><strong>count<\/strong>\uff1a\u8868\u793a\u66ff\u6362\u7684\u6700\u5927\u6b21\u6570\uff0c\u9ed8\u8ba4\u503c\u4e3a0\uff0c\u8868\u793a\u66ff\u6362\u6240\u6709\u5339\u914d\u3002<\/li>\n<li><strong>flags<\/strong>\uff1a\u7528\u4e8e\u4fee\u6539\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u5339\u914d\u65b9\u5f0f\u3002<\/li>\n<\/ul>\n<p><p>\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>text = &quot;The r<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n in Spain&quot;<\/p>\n<p>new_text = re.sub(r&quot;ain&quot;, &quot;xyz&quot;, text)<\/p>\n<p>print(new_text)  # \u8f93\u51fa &quot;The rxyz in Spxyz&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u5904\u7406\u590d\u6742\u7684\u5b57\u7b26\u4e32\u66ff\u6362\uff0c\u4f8b\u5982\u66ff\u6362\u591a\u4e2a\u6a21\u5f0f\u6216\u5728\u66ff\u6362\u4e2d\u4f7f\u7528\u6761\u4ef6\u903b\u8f91\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001Pandas\u5e93\u4e2d\u7684\u66ff\u6362\u65b9\u6cd5<\/h2>\n<\/p>\n<p><p>Pandas\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u6570\u636e\u5206\u6790\u548c\u64cd\u4f5c\u5e93\uff0c\u5e7f\u6cdb\u7528\u4e8e\u6570\u636e\u79d1\u5b66\u9886\u57df\u3002Pandas\u63d0\u4f9b\u4e86<code>replace()<\/code>\u65b9\u6cd5\uff0c\u7528\u4e8e\u5728DataFrame\u6216Series\u4e2d\u66ff\u6362\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h3>1. Series\u4e2d\u7684\u66ff\u6362<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8ePandas\u7684Series\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528<code>replace()<\/code>\u65b9\u6cd5\u8fdb\u884c\u66ff\u6362\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>s = pd.Series([1, 2, 3, 4, 1])<\/p>\n<p>s_replaced = s.replace(1, 10)<\/p>\n<p>print(s_replaced)  # \u8f93\u51fa [10, 2, 3, 4, 10]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. DataFrame\u4e2d\u7684\u66ff\u6362<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8eDataFrame\uff0c\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">df = pd.DataFrame({<\/p>\n<p>    &#39;A&#39;: [1, 2, 3, 4],<\/p>\n<p>    &#39;B&#39;: [5, 6, 7, 8]<\/p>\n<p>})<\/p>\n<p>df_replaced = df.replace({1: 100, 5: 500})<\/p>\n<p>print(df_replaced)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Pandas\u7684<code>replace()<\/code>\u65b9\u6cd5\u975e\u5e38\u5f3a\u5927\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u5178\u6307\u5b9a\u591a\u4e2a\u66ff\u6362\u89c4\u5219\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001Numpy\u5e93\u4e2d\u7684\u66ff\u6362\u65b9\u6cd5<\/h2>\n<\/p>\n<p><p>Numpy\u662fPython\u4e2d\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u7684\u57fa\u7840\u5e93\u3002<code>numpy.where()<\/code>\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u57fa\u4e8e\u6761\u4ef6\u7684\u66ff\u6362\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>arr = np.array([1, 2, 3, 4, 5])<\/p>\n<p>new_arr = np.where(arr &gt; 3, 10, arr)<\/p>\n<p>print(new_arr)  # \u8f93\u51fa [ 1,  2,  3, 10, 10]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u793a\u4f8b\u4e2d\uff0c<code>numpy.where()<\/code>\u51fd\u6570\u68c0\u67e5\u6570\u7ec4\u4e2d\u54ea\u4e9b\u5143\u7d20\u5927\u4e8e3\uff0c\u7136\u540e\u5c06\u8fd9\u4e9b\u5143\u7d20\u66ff\u6362\u4e3a10\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001\u5b57\u5178\u7684\u952e\u503c\u66ff\u6362<\/h2>\n<\/p>\n<p><p>\u5728\u5904\u7406Python\u4e2d\u7684\u5b57\u5178\u65f6\uff0c\u6709\u65f6\u9700\u8981\u66ff\u6362\u5b57\u5178\u4e2d\u7684\u67d0\u4e9b\u952e\u6216\u503c\u3002\u867d\u7136Python\u6ca1\u6709\u76f4\u63a5\u7684\u65b9\u6cd5\u6765\u66ff\u6362\u5b57\u5178\u4e2d\u7684\u952e\u6216\u503c\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7\u8fed\u4ee3\u5b57\u5178\u5e76\u6784\u5efa\u65b0\u7684\u5b57\u5178\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><h3>1. \u66ff\u6362\u5b57\u5178\u4e2d\u7684\u503c<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">my_dict = {&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3}<\/p>\n<p>new_dict = {k: (v if v != 2 else 20) for k, v in my_dict.items()}<\/p>\n<p>print(new_dict)  # \u8f93\u51fa {&#39;a&#39;: 1, &#39;b&#39;: 20, &#39;c&#39;: 3}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u66ff\u6362\u5b57\u5178\u4e2d\u7684\u952e<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">my_dict = {&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3}<\/p>\n<p>new_dict = {&#39;d&#39; if k == &#39;a&#39; else k: v for k, v in my_dict.items()}<\/p>\n<p>print(new_dict)  # \u8f93\u51fa {&#39;d&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7075\u6d3b\u5730\u66ff\u6362\u5b57\u5178\u4e2d\u7684\u952e\u548c\u503c\u3002<\/p>\n<\/p>\n<p><h2>\u4e94\u3001\u5217\u8868\u4e2d\u7684\u5143\u7d20\u66ff\u6362<\/h2>\n<\/p>\n<p><p>\u5217\u8868\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\uff0c\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u6216\u5faa\u73af\u6765\u66ff\u6362\u5217\u8868\u4e2d\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h3>1. \u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">my_list = [1, 2, 3, 4, 1]<\/p>\n<p>new_list = [10 if x == 1 else x for x in my_list]<\/p>\n<p>print(new_list)  # \u8f93\u51fa [10, 2, 3, 4, 10]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u4f7f\u7528\u5faa\u73af<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">my_list = [1, 2, 3, 4, 1]<\/p>\n<p>for i in range(len(my_list)):<\/p>\n<p>    if my_list[i] == 1:<\/p>\n<p>        my_list[i] = 10<\/p>\n<p>print(my_list)  # \u8f93\u51fa [10, 2, 3, 4, 10]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u9ad8\u6548\u5730\u66ff\u6362\u5217\u8868\u4e2d\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h2>\u516d\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u66ff\u6362\u6570\u636e\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u6570\u636e\u7684\u7ed3\u6784\u548c\u66ff\u6362\u7684\u590d\u6742\u6027\u3002<strong>\u5b57\u7b26\u4e32\u7684replace\u65b9\u6cd5\u9002\u7528\u4e8e\u7b80\u5355\u7684\u66ff\u6362<\/strong>\uff0c<strong>\u6b63\u5219\u8868\u8fbe\u5f0f\u9002\u7528\u4e8e\u590d\u6742\u7684\u6a21\u5f0f\u66ff\u6362<\/strong>\uff0c<strong>Pandas\u548cNumpy\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u529f\u80fd\u6765\u5904\u7406\u6570\u636e\u6846\u548c\u6570\u7ec4\u4e2d\u7684\u66ff\u6362<\/strong>\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u6548\u7387\u548c\u53ef\u8bfb\u6027\u3002\u65e0\u8bba\u662f\u5904\u7406\u7b80\u5355\u5b57\u7b26\u4e32\u8fd8\u662f\u590d\u6742\u6570\u636e\u7ed3\u6784\uff0cPython\u7684\u66ff\u6362\u65b9\u6cd5\u90fd\u80fd\u6ee1\u8db3\u4f60\u7684\u9700\u6c42\u3002\u901a\u8fc7\u7075\u6d3b\u8fd0\u7528\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u51b3\u5404\u79cd\u6570\u636e\u66ff\u6362\u95ee\u9898\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Python\u4e2d\uff0c\u5982\u4f55\u4f7f\u7528\u5b57\u7b26\u4e32\u65b9\u6cd5\u8fdb\u884c\u6570\u636e\u66ff\u6362\uff1f<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u5b57\u7b26\u4e32\u65b9\u6cd5\u6765\u5b9e\u73b0\u6570\u636e\u66ff\u6362\uff0c\u4f8b\u5982<code>str.replace()<\/code>\u3002\u8be5\u65b9\u6cd5\u7528\u4e8e\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u6307\u5b9a\u5b50\u5b57\u7b26\u4e32\u66ff\u6362\u4e3a\u65b0\u7684\u5b50\u5b57\u7b26\u4e32\u3002\u8bed\u6cd5\u4e3a<code>string.replace(old, new, count)<\/code>\uff0c\u5176\u4e2d<code>old<\/code>\u662f\u8981\u88ab\u66ff\u6362\u7684\u5b50\u5b57\u7b26\u4e32\uff0c<code>new<\/code>\u662f\u66ff\u6362\u540e\u7684\u65b0\u5b57\u7b26\u4e32\uff0c<code>count<\/code>\u662f\u53ef\u9009\u53c2\u6570\uff0c\u7528\u4e8e\u6307\u5b9a\u66ff\u6362\u7684\u6b21\u6570\u3002\u4f8b\u5982\uff0c<code>text.replace(&quot;old_value&quot;, &quot;new_value&quot;, 1)<\/code>\u5c06\u53ea\u66ff\u6362\u7b2c\u4e00\u4e2a\u51fa\u73b0\u7684\u201cold_value\u201d\u3002<\/p>\n<p><strong>Python\u4e2d\u662f\u5426\u53ef\u4ee5\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u66f4\u590d\u6742\u7684\u66ff\u6362\uff1f<\/strong><br \/>\u786e\u5b9e\u53ef\u4ee5\uff0cPython\u7684<code>re<\/code>\u6a21\u5757\u652f\u6301\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u590d\u6742\u7684\u6a21\u5f0f\u5339\u914d\u548c\u66ff\u6362\u3002<code>re.sub(pattern, replacement, string, count=0)<\/code>\u51fd\u6570\u80fd\u591f\u6839\u636e\u7ed9\u5b9a\u7684\u6a21\u5f0f\u67e5\u627e\u5b57\u7b26\u4e32\u5e76\u8fdb\u884c\u66ff\u6362\u3002\u4f8b\u5982\uff0c<code>re.sub(r&#39;\\d+&#39;, &#39;number&#39;, text)<\/code>\u53ef\u4ee5\u5c06\u6587\u672c\u4e2d\u7684\u6240\u6709\u6570\u5b57\u66ff\u6362\u4e3a\u201cnumber\u201d\u3002\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u9002\u5408\u9700\u8981\u8fdb\u884c\u590d\u6742\u5339\u914d\u7684\u60c5\u51b5\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u66ff\u6362\u5217\u8868\u4e2d\u7684\u591a\u4e2a\u5143\u7d20\uff1f<\/strong><br \/>\u5982\u679c\u9700\u8981\u66ff\u6362\u5217\u8868\u4e2d\u7684\u591a\u4e2a\u5143\u7d20\uff0c\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u7ed3\u5408\u6761\u4ef6\u8bed\u53e5\u8fdb\u884c\u5904\u7406\u3002\u901a\u8fc7\u904d\u5386\u5217\u8868\uff0c\u53ef\u4ee5\u68c0\u67e5\u6bcf\u4e2a\u5143\u7d20\u5e76\u8fdb\u884c\u66ff\u6362\u3002\u4f8b\u5982\uff0c<code>new_list = [x if x != &#39;old_value&#39; else &#39;new_value&#39; for x in old_list]<\/code>\u5c06\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u5217\u8868\uff0c\u5176\u4e2d\u7684\u201cold_value\u201d\u88ab\u66ff\u6362\u4e3a\u201cnew_value\u201d\u3002\u8fd9\u79cd\u65b9\u6cd5\u7075\u6d3b\u4e14\u6613\u4e8e\u7406\u89e3\uff0c\u9002\u7528\u4e8e\u7b80\u5355\u7684\u66ff\u6362\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u8fdb\u884c\u6570\u636e\u66ff\u6362\u7684\u5e38\u7528\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528\u5b57\u7b26\u4e32\u7684replace\u65b9\u6cd5\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u3001Pandas\u5e93\u7684repl [&hellip;]","protected":false},"author":3,"featured_media":957734,"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\/957725"}],"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=957725"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/957725\/revisions"}],"predecessor-version":[{"id":957735,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/957725\/revisions\/957735"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/957734"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=957725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=957725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=957725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}