{"id":1042129,"date":"2024-12-31T12:54:51","date_gmt":"2024-12-31T04:54:51","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1042129.html"},"modified":"2024-12-31T12:54:53","modified_gmt":"2024-12-31T04:54:53","slug":"python%e4%b8%ad%e5%ad%97%e5%85%b8%e5%a6%82%e4%bd%95%e6%98%af%e5%80%bc%e5%8a%a0%e4%b8%80","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1042129.html","title":{"rendered":"python\u4e2d\u5b57\u5178\u5982\u4f55\u662f\u503c\u52a0\u4e00"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/8576bdaf-3053-4e5d-86e3-cd685e6a7005.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u4e2d\u5b57\u5178\u5982\u4f55\u662f\u503c\u52a0\u4e00\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u5b57\u5178\u7684\u503c\u52a0\u4e00\uff0c\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5\u952e\u662f\u5426\u5b58\u5728\u3001\u76f4\u63a5\u9012\u589e\u503c\u3001\u4f7f\u7528setdefault\u65b9\u6cd5\u3002<\/strong> \u5176\u4e2d\u6700\u5e38\u7528\u4e14\u76f4\u89c2\u7684\u65b9\u6cd5\u662f\u76f4\u63a5\u9012\u589e\u503c\u3002\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u8981\u5728Python\u4e2d\u5b57\u5178\u4e2d\u5c06\u67d0\u4e2a\u952e\u5bf9\u5e94\u7684\u503c\u52a0\u4e00\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u68c0\u67e5\u952e\u662f\u5426\u5b58\u5728\u5e76\u76f4\u63a5\u9012\u589e\u503c<\/h3>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u662f\u6700\u76f4\u89c2\u7684\uff0c\u4e5f\u662f\u6700\u5e38\u7528\u7684\u3002\u5728\u8fd9\u79cd\u65b9\u6cd5\u4e2d\uff0c\u9996\u5148\u68c0\u67e5\u5b57\u5178\u4e2d\u662f\u5426\u5b58\u5728\u67d0\u4e2a\u952e\uff0c\u5982\u679c\u5b58\u5728\u5219\u5c06\u5176\u5bf9\u5e94\u7684\u503c\u52a0\u4e00\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u5219\u521d\u59cb\u5316\u8be5\u952e\u7684\u503c\u4e3a1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">my_dict = {&#39;apple&#39;: 2, &#39;banana&#39;: 3}<\/p>\n<h2><strong>\u65b9\u6cd51\uff1a\u68c0\u67e5\u952e\u662f\u5426\u5b58\u5728\u5e76\u76f4\u63a5\u9012\u589e\u503c<\/strong><\/h2>\n<p>if &#39;apple&#39; in my_dict:<\/p>\n<p>    my_dict[&#39;apple&#39;] += 1<\/p>\n<p>else:<\/p>\n<p>    my_dict[&#39;apple&#39;] = 1<\/p>\n<p>print(my_dict)  # {&#39;apple&#39;: 3, &#39;banana&#39;: 3}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8be6\u7ec6\u89e3\u91ca\uff1a<\/strong><\/p>\n<\/p>\n<ol>\n<li><strong>\u68c0\u67e5\u952e\u662f\u5426\u5b58\u5728<\/strong>\uff1a\u4f7f\u7528<code>if<\/code>\u8bed\u53e5\u68c0\u67e5\u5b57\u5178\u4e2d\u662f\u5426\u5b58\u5728\u6307\u5b9a\u952e\u3002<\/li>\n<li><strong>\u9012\u589e\u503c<\/strong>\uff1a\u5982\u679c\u952e\u5b58\u5728\uff0c\u5219\u4f7f\u7528<code>+= 1<\/code>\u64cd\u4f5c\u5c06\u5176\u5bf9\u5e94\u7684\u503c\u52a0\u4e00\u3002<\/li>\n<li><strong>\u521d\u59cb\u5316\u952e\u503c<\/strong>\uff1a\u5982\u679c\u952e\u4e0d\u5b58\u5728\uff0c\u5219\u5c06\u952e\u7684\u503c\u521d\u59cb\u5316\u4e3a1\u3002<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u4f7f\u7528<code>setdefault<\/code>\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p><code>setdefault<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5728\u5b57\u5178\u4e2d\u4e0d\u5b58\u5728\u6307\u5b9a\u952e\u65f6\uff0c\u7ed9\u8be5\u952e\u8d4b\u4e00\u4e2a\u9ed8\u8ba4\u503c\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u7b80\u5316\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">my_dict = {&#39;apple&#39;: 2, &#39;banana&#39;: 3}<\/p>\n<h2><strong>\u65b9\u6cd52\uff1a\u4f7f\u7528setdefault\u65b9\u6cd5<\/strong><\/h2>\n<p>my_dict[&#39;apple&#39;] = my_dict.setdefault(&#39;apple&#39;, 0) + 1<\/p>\n<p>print(my_dict)  # {&#39;apple&#39;: 3, &#39;banana&#39;: 3}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8be6\u7ec6\u89e3\u91ca\uff1a<\/strong><\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528<code>setdefault<\/code><\/strong>\uff1a<code>setdefault<\/code>\u65b9\u6cd5\u4f1a\u68c0\u67e5\u5b57\u5178\u4e2d\u662f\u5426\u5b58\u5728\u6307\u5b9a\u952e\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u5219\u5c06\u5176\u503c\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u503c0\u3002<\/li>\n<li><strong>\u9012\u589e\u503c<\/strong>\uff1a\u4f7f\u7528<code>+= 1<\/code>\u64cd\u4f5c\u5c06\u952e\u5bf9\u5e94\u7684\u503c\u52a0\u4e00\u3002<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u4f7f\u7528<code>defaultdict<\/code>\u7c7b<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u9891\u7e41\u8fdb\u884c\u6b64\u7c7b\u64cd\u4f5c\uff0c\u53ef\u4ee5\u4f7f\u7528<code>collections<\/code>\u6a21\u5757\u4e2d\u7684<code>defaultdict<\/code>\u7c7b\u6765\u7b80\u5316\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from collections import defaultdict<\/p>\n<p>my_dict = defaultdict(int)  # \u9ed8\u8ba4\u503c\u4e3a0<\/p>\n<p>my_dict[&#39;apple&#39;] = 2<\/p>\n<p>my_dict[&#39;banana&#39;] = 3<\/p>\n<h2><strong>\u65b9\u6cd53\uff1a\u4f7f\u7528defaultdict\u7c7b<\/strong><\/h2>\n<p>my_dict[&#39;apple&#39;] += 1<\/p>\n<p>print(my_dict)  # {&#39;apple&#39;: 3, &#39;banana&#39;: 3}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8be6\u7ec6\u89e3\u91ca\uff1a<\/strong><\/p>\n<\/p>\n<ol>\n<li><strong>\u5bfc\u5165<code>defaultdict<\/code><\/strong>\uff1a\u4ece<code>collections<\/code>\u6a21\u5757\u5bfc\u5165<code>defaultdict<\/code>\u7c7b\u3002<\/li>\n<li><strong>\u521d\u59cb\u5316<code>defaultdict<\/code><\/strong>\uff1a\u4f7f\u7528<code>defaultdict(int)<\/code>\u521d\u59cb\u5316\u5b57\u5178\uff0c\u9ed8\u8ba4\u503c\u4e3a0\u3002<\/li>\n<li><strong>\u9012\u589e\u503c<\/strong>\uff1a\u76f4\u63a5\u4f7f\u7528<code>+= 1<\/code>\u64cd\u4f5c\u5c06\u952e\u5bf9\u5e94\u7684\u503c\u52a0\u4e00\u3002<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u4f7f\u7528<code>Counter<\/code>\u7c7b<\/h3>\n<\/p>\n<p><p><code>collections<\/code>\u6a21\u5757\u4e2d\u7684<code>Counter<\/code>\u7c7b\u4e5f\u662f\u5904\u7406\u8ba1\u6570\u95ee\u9898\u7684\u597d\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from collections import Counter<\/p>\n<p>my_dict = Counter({&#39;apple&#39;: 2, &#39;banana&#39;: 3})<\/p>\n<h2><strong>\u65b9\u6cd54\uff1a\u4f7f\u7528Counter\u7c7b<\/strong><\/h2>\n<p>my_dict[&#39;apple&#39;] += 1<\/p>\n<p>print(my_dict)  # Counter({&#39;apple&#39;: 3, &#39;banana&#39;: 3})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8be6\u7ec6\u89e3\u91ca\uff1a<\/strong><\/p>\n<\/p>\n<ol>\n<li><strong>\u5bfc\u5165<code>Counter<\/code><\/strong>\uff1a\u4ece<code>collections<\/code>\u6a21\u5757\u5bfc\u5165<code>Counter<\/code>\u7c7b\u3002<\/li>\n<li><strong>\u521d\u59cb\u5316<code>Counter<\/code><\/strong>\uff1a\u4f7f\u7528<code>Counter<\/code>\u521d\u59cb\u5316\u5b57\u5178\u3002<\/li>\n<li><strong>\u9012\u589e\u503c<\/strong>\uff1a\u76f4\u63a5\u4f7f\u7528<code>+= 1<\/code>\u64cd\u4f5c\u5c06\u952e\u5bf9\u5e94\u7684\u503c\u52a0\u4e00\u3002<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u4f7f\u7528<code>get<\/code>\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p><code>get<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5728\u952e\u4e0d\u5b58\u5728\u65f6\u8fd4\u56de\u4e00\u4e2a\u9ed8\u8ba4\u503c\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u7b80\u5316\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">my_dict = {&#39;apple&#39;: 2, &#39;banana&#39;: 3}<\/p>\n<h2><strong>\u65b9\u6cd55\uff1a\u4f7f\u7528get\u65b9\u6cd5<\/strong><\/h2>\n<p>my_dict[&#39;apple&#39;] = my_dict.get(&#39;apple&#39;, 0) + 1<\/p>\n<p>print(my_dict)  # {&#39;apple&#39;: 3, &#39;banana&#39;: 3}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8be6\u7ec6\u89e3\u91ca\uff1a<\/strong><\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528<code>get<\/code>\u65b9\u6cd5<\/strong>\uff1a<code>get<\/code>\u65b9\u6cd5\u4f1a\u5728\u952e\u4e0d\u5b58\u5728\u65f6\u8fd4\u56de\u4e00\u4e2a\u9ed8\u8ba4\u503c0\u3002<\/li>\n<li><strong>\u9012\u589e\u503c<\/strong>\uff1a\u4f7f\u7528<code>+= 1<\/code>\u64cd\u4f5c\u5c06\u952e\u5bf9\u5e94\u7684\u503c\u52a0\u4e00\u3002<\/li>\n<\/ol>\n<p><h3>\u516d\u3001\u5e94\u7528\u573a\u666f\u4e0e\u6027\u80fd\u8003\u8651<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u548c\u6027\u80fd\u9700\u6c42\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u7b80\u5355\u573a\u666f<\/strong>\uff1a\u5bf9\u4e8e\u7b80\u5355\u7684\u573a\u666f\uff0c\u4f7f\u7528\u76f4\u63a5\u68c0\u67e5\u952e\u662f\u5426\u5b58\u5728\u5e76\u9012\u589e\u503c\u7684\u65b9\u6cd5\u5373\u53ef\u3002<\/li>\n<li><strong>\u590d\u6742\u573a\u666f<\/strong>\uff1a\u5bf9\u4e8e\u9700\u8981\u9891\u7e41\u8fdb\u884c\u6b64\u7c7b\u64cd\u4f5c\u7684\u590d\u6742\u573a\u666f\uff0c<code>defaultdict<\/code>\u548c<code>Counter<\/code>\u7c7b\u66f4\u4e3a\u5408\u9002\u3002<\/li>\n<li><strong>\u6027\u80fd\u8003\u8651<\/strong>\uff1a\u5728\u9ad8\u6027\u80fd\u8981\u6c42\u7684\u573a\u666f\u4e0b\uff0c\u5c3d\u91cf\u907f\u514d\u4f7f\u7528\u590d\u6742\u7684\u903b\u8f91\uff0c\u9009\u62e9\u6700\u7b80\u6d01\u3001\u9ad8\u6548\u7684\u65b9\u6cd5\u3002<\/li>\n<\/ol>\n<p><h3>\u4e03\u3001\u793a\u4f8b\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u5c55\u793a\u4e86\u4e0a\u8ff0\u51e0\u79cd\u65b9\u6cd5\u7684\u4f7f\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from collections import defaultdict, Counter<\/p>\n<h2><strong>\u521d\u59cb\u5316\u5b57\u5178<\/strong><\/h2>\n<p>my_dict1 = {&#39;apple&#39;: 2, &#39;banana&#39;: 3}<\/p>\n<p>my_dict2 = {&#39;apple&#39;: 2, &#39;banana&#39;: 3}<\/p>\n<p>my_dict3 = defaultdict(int, {&#39;apple&#39;: 2, &#39;banana&#39;: 3})<\/p>\n<p>my_dict4 = Counter({&#39;apple&#39;: 2, &#39;banana&#39;: 3})<\/p>\n<p>my_dict5 = {&#39;apple&#39;: 2, &#39;banana&#39;: 3}<\/p>\n<h2><strong>\u65b9\u6cd51\uff1a\u68c0\u67e5\u952e\u662f\u5426\u5b58\u5728\u5e76\u76f4\u63a5\u9012\u589e\u503c<\/strong><\/h2>\n<p>if &#39;apple&#39; in my_dict1:<\/p>\n<p>    my_dict1[&#39;apple&#39;] += 1<\/p>\n<p>else:<\/p>\n<p>    my_dict1[&#39;apple&#39;] = 1<\/p>\n<h2><strong>\u65b9\u6cd52\uff1a\u4f7f\u7528setdefault\u65b9\u6cd5<\/strong><\/h2>\n<p>my_dict2[&#39;apple&#39;] = my_dict2.setdefault(&#39;apple&#39;, 0) + 1<\/p>\n<h2><strong>\u65b9\u6cd53\uff1a\u4f7f\u7528defaultdict\u7c7b<\/strong><\/h2>\n<p>my_dict3[&#39;apple&#39;] += 1<\/p>\n<h2><strong>\u65b9\u6cd54\uff1a\u4f7f\u7528Counter\u7c7b<\/strong><\/h2>\n<p>my_dict4[&#39;apple&#39;] += 1<\/p>\n<h2><strong>\u65b9\u6cd55\uff1a\u4f7f\u7528get\u65b9\u6cd5<\/strong><\/h2>\n<p>my_dict5[&#39;apple&#39;] = my_dict5.get(&#39;apple&#39;, 0) + 1<\/p>\n<h2><strong>\u6253\u5370\u7ed3\u679c<\/strong><\/h2>\n<p>print(my_dict1)  # {&#39;apple&#39;: 3, &#39;banana&#39;: 3}<\/p>\n<p>print(my_dict2)  # {&#39;apple&#39;: 3, &#39;banana&#39;: 3}<\/p>\n<p>print(my_dict3)  # defaultdict(&lt;class &#39;int&#39;&gt;, {&#39;apple&#39;: 3, &#39;banana&#39;: 3})<\/p>\n<p>print(my_dict4)  # Counter({&#39;apple&#39;: 3, &#39;banana&#39;: 3})<\/p>\n<p>print(my_dict5)  # {&#39;apple&#39;: 3, &#39;banana&#39;: 3}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u7075\u6d3b\u5730\u5728Python\u4e2d\u5b57\u5178\u4e2d\u5b9e\u73b0\u503c\u7684\u9012\u589e\u64cd\u4f5c\u3002\u9009\u62e9\u9002\u5408\u81ea\u5df1\u9700\u6c42\u7684\u65b9\u6cd5\uff0c\u5c06\u4f7f\u4ee3\u7801\u66f4\u52a0\u7b80\u6d01\u3001\u9ad8\u6548\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u5b57\u5178\u4e2d\u5bf9\u7279\u5b9a\u952e\u7684\u503c\u8fdb\u884c\u52a0\u4e00\u64cd\u4f5c\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u7d22\u5f15\u6765\u8bbf\u95ee\u5b57\u5178\u4e2d\u7684\u503c\uff0c\u5e76\u5229\u7528\u52a0\u6cd5\u8fd0\u7b97\u7b26\u5c06\u5176\u52a0\u4e00\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5b57\u5178\u4e2d\u6709\u4e00\u4e2a\u952e\u4e3a&#39;count&#39;\uff0c\u53ef\u4ee5\u4f7f\u7528<code>my_dict[&#39;count&#39;] += 1<\/code>\u6765\u5b9e\u73b0\u5bf9\u8be5\u952e\u7684\u503c\u52a0\u4e00\u3002\u5982\u679c\u8be5\u952e\u4e0d\u5b58\u5728\uff0c\u60a8\u53ef\u4ee5\u5148\u521b\u5efa\u5b83\u5e76\u8d4b\u521d\u503c\u4e3a1\u3002<\/p>\n<p><strong>\u5982\u679c\u5b57\u5178\u4e2d\u7684\u952e\u4e0d\u5b58\u5728\uff0c\u6211\u8be5\u5982\u4f55\u5904\u7406\uff1f<\/strong><br \/>\u5904\u7406\u5b57\u5178\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>dict.get()<\/code>\u65b9\u6cd5\u6765\u907f\u514dKeyError\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>my_dict[&#39;count&#39;] = my_dict.get(&#39;count&#39;, 0) + 1<\/code>\uff0c\u5982\u679c&#39;count&#39;\u952e\u4e0d\u5b58\u5728\uff0c<code>get()<\/code>\u65b9\u6cd5\u5c06\u8fd4\u56de\u9ed8\u8ba4\u503c0\uff0c\u4ece\u800c\u5b89\u5168\u5730\u5b9e\u73b0\u52a0\u4e00\u64cd\u4f5c\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u5bf9\u5b57\u5178\u4e2d\u7684\u591a\u4e2a\u952e\u540c\u65f6\u8fdb\u884c\u52a0\u4e00\u64cd\u4f5c\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u5faa\u73af\u904d\u5386\u5b57\u5178\u4e2d\u7684\u591a\u4e2a\u952e\u6765\u5b9e\u73b0\u5bf9\u591a\u4e2a\u503c\u7684\u52a0\u4e00\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u4ee3\u7801\uff1a  <\/p>\n<pre><code class=\"language-python\">for key in [&#39;key1&#39;, &#39;key2&#39;, &#39;key3&#39;]:\n    my_dict[key] = my_dict.get(key, 0) + 1\n<\/code><\/pre>\n<p>\u8fd9\u6837\uff0c\u6307\u5b9a\u7684\u591a\u4e2a\u952e\u7684\u503c\u5c06\u540c\u65f6\u589e\u52a01\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5b57\u5178\u7684\u503c\u52a0\u4e00\uff0c\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5\u952e\u662f\u5426\u5b58\u5728\u3001\u76f4\u63a5\u9012\u589e\u503c\u3001\u4f7f\u7528setdefault\u65b9\u6cd5\u3002 \u5176\u4e2d\u6700\u5e38\u7528\u4e14 [&hellip;]","protected":false},"author":3,"featured_media":1042140,"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\/1042129"}],"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=1042129"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1042129\/revisions"}],"predecessor-version":[{"id":1042142,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1042129\/revisions\/1042142"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1042140"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1042129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1042129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1042129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}