{"id":1069244,"date":"2024-12-31T16:50:14","date_gmt":"2024-12-31T08:50:14","guid":{"rendered":""},"modified":"2024-12-31T16:50:16","modified_gmt":"2024-12-31T08:50:16","slug":"python%e5%a6%82%e4%bd%95%e7%bb%9f%e8%ae%a1%e5%88%97%e8%a1%a8%e4%b8%ad%e6%95%b0%e6%8d%ae%e7%9a%84%e4%b8%aa%e6%95%b0","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1069244.html","title":{"rendered":"python\u5982\u4f55\u7edf\u8ba1\u5217\u8868\u4e2d\u6570\u636e\u7684\u4e2a\u6570"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/2b51c0d0-9280-46ca-8aea-cd5a5b720c45.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u7edf\u8ba1\u5217\u8868\u4e2d\u6570\u636e\u7684\u4e2a\u6570\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u7edf\u8ba1\u5217\u8868\u4e2d\u6570\u636e\u7684\u4e2a\u6570<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u7edf\u8ba1\u5217\u8868\u4e2d\u6570\u636e\u7684\u4e2a\u6570\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u3001\u5faa\u73af\u904d\u5386\u3001\u4ee5\u53ca\u5229\u7528\u4e00\u4e9bPython\u5e93\u3002<strong>\u53ef\u4ee5\u4f7f\u7528len()\u51fd\u6570\u3001\u4f7f\u7528count()\u65b9\u6cd5\u3001\u901a\u8fc7\u5faa\u73af\u904d\u5386\u5217\u8868\u3001\u4f7f\u7528Counter\u7c7b\u7b49<\/strong>\u3002\u5176\u4e2d\uff0c<strong>len()\u51fd\u6570<\/strong>\u662f\u6700\u7b80\u5355\u548c\u76f4\u63a5\u7684\u65b9\u6cd5\uff0c\u901a\u8fc7\u5b83\u53ef\u4ee5\u5feb\u901f\u83b7\u5f97\u5217\u8868\u4e2d\u5143\u7d20\u7684\u603b\u4e2a\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">my_list = [1, 2, 3, 4, 5, 6]<\/p>\n<p>print(len(my_list))  # \u8f93\u51fa: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528len()\u51fd\u6570<\/h3>\n<\/p>\n<p><p>Python\u7684\u5185\u7f6e\u51fd\u6570 <code>len()<\/code> \u662f\u6700\u7b80\u5355\u548c\u76f4\u63a5\u7684\u65b9\u6cd5\uff0c\u7528\u6765\u8fd4\u56de\u5217\u8868\u4e2d\u5143\u7d20\u7684\u603b\u4e2a\u6570\u3002\u8fd9\u4e2a\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u4efb\u4f55\u652f\u6301\u5e8f\u5217\u7c7b\u578b\u7684\u5bf9\u8c61\uff0c\u5305\u62ec\u5217\u8868\u3001\u5143\u7ec4\u3001\u5b57\u7b26\u4e32\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">my_list = [1, 2, 3, 4, 5, 6]<\/p>\n<p>print(len(my_list))  # \u8f93\u51fa: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8c03\u7528 <code>len()<\/code> \u51fd\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u5feb\u901f\u5f97\u5230\u5217\u8868\u4e2d\u6240\u6709\u5143\u7d20\u7684\u603b\u6570\uff0c\u8fd9\u662f\u7edf\u8ba1\u5217\u8868\u6570\u636e\u4e2a\u6570\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528count()\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u6211\u4eec\u9700\u8981\u7edf\u8ba1\u67d0\u4e2a\u7279\u5b9a\u5143\u7d20\u5728\u5217\u8868\u4e2d\u51fa\u73b0\u7684\u6b21\u6570\uff0c\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u7684 <code>count()<\/code> \u65b9\u6cd5\u3002\u8fd9\u4e2a\u65b9\u6cd5\u63a5\u53d7\u4e00\u4e2a\u53c2\u6570\uff0c\u8868\u793a\u9700\u8981\u7edf\u8ba1\u7684\u5143\u7d20\uff0c\u5e76\u8fd4\u56de\u8be5\u5143\u7d20\u5728\u5217\u8868\u4e2d\u7684\u51fa\u73b0\u6b21\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">my_list = [1, 2, 3, 3, 4, 5, 3]<\/p>\n<p>print(my_list.count(3))  # \u8f93\u51fa: 3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>count()<\/code> \u65b9\u6cd5\u7edf\u8ba1\u4e86\u5143\u7d20 <code>3<\/code> \u5728 <code>my_list<\/code> \u4e2d\u51fa\u73b0\u7684\u6b21\u6570\uff0c\u5e76\u8fd4\u56de <code>3<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u901a\u8fc7\u5faa\u73af\u904d\u5386\u5217\u8868<\/h3>\n<\/p>\n<p><p>\u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7\u5faa\u73af\u904d\u5386\u5217\u8868\uff0c\u624b\u52a8\u7edf\u8ba1\u5143\u7d20\u7684\u4e2a\u6570\u3002\u867d\u7136\u8fd9\u79cd\u65b9\u6cd5\u6bd4\u8f83\u7e41\u7410\uff0c\u4f46\u5bf9\u4e8e\u7406\u89e3\u5217\u8868\u7684\u7ed3\u6784\u548c\u64cd\u4f5c\u975e\u5e38\u6709\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">my_list = [1, 2, 3, 4, 5, 6]<\/p>\n<p>count = 0<\/p>\n<p>for item in my_list:<\/p>\n<p>    count += 1<\/p>\n<p>print(count)  # \u8f93\u51fa: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u521d\u59cb\u5316\u4e86\u4e00\u4e2a\u8ba1\u6570\u5668 <code>count<\/code>\uff0c\u6bcf\u904d\u5386\u4e00\u4e2a\u5143\u7d20\uff0c\u8ba1\u6570\u5668\u52a0\u4e00\uff0c\u6700\u540e\u8f93\u51fa\u8ba1\u6570\u5668\u7684\u503c\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528Counter\u7c7b<\/h3>\n<\/p>\n<p><p>Python\u7684 <code>collections<\/code> \u6a21\u5757\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u7c7b <code>Counter<\/code>\uff0c\u5b83\u53ef\u4ee5\u7528\u6765\u7edf\u8ba1\u53ef\u54c8\u5e0c\u5bf9\u8c61\u7684\u4e2a\u6570\u3002<code>Counter<\/code> \u7c7b\u5bf9\u4e8e\u7edf\u8ba1\u5217\u8868\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u51fa\u73b0\u6b21\u6570\u975e\u5e38\u9ad8\u6548\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from collections import Counter<\/p>\n<p>my_list = [1, 2, 3, 3, 4, 5, 3]<\/p>\n<p>counter = Counter(my_list)<\/p>\n<p>print(counter)  # \u8f93\u51fa: Counter({3: 3, 1: 1, 2: 1, 4: 1, 5: 1})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>Counter<\/code> \u7c7b\u7684\u7ed3\u679c\u662f\u4e00\u4e2a\u5b57\u5178\uff0c\u952e\u662f\u5217\u8868\u4e2d\u7684\u5143\u7d20\uff0c\u503c\u662f\u8fd9\u4e9b\u5143\u7d20\u51fa\u73b0\u7684\u6b21\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528numpy\u5e93<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u5728\u5904\u7406\u5927\u6570\u636e\u96c6\u65f6\uff0c<code>numpy<\/code> \u5e93\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\u3002\u5b83\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u7ec4\u64cd\u4f5c\uff0c\u8fd8\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u6570\u636e\u7edf\u8ba1\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>my_list = [1, 2, 3, 4, 5, 6]<\/p>\n<p>np_array = np.array(my_list)<\/p>\n<p>print(np_array.size)  # \u8f93\u51fa: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>numpy<\/code> \u7684 <code>size<\/code> \u5c5e\u6027\u53ef\u4ee5\u5feb\u901f\u8fd4\u56de\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u603b\u4e2a\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528pandas\u5e93<\/h3>\n<\/p>\n<p><p><code>pandas<\/code> \u662f\u53e6\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u5e93\uff0c\u7279\u522b\u9002\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u6570\u636e\u79d1\u5b66\u9886\u57df\u3002\u4f7f\u7528 <code>pandas<\/code> \u7684 <code>value_counts()<\/code> \u65b9\u6cd5\u53ef\u4ee5\u65b9\u4fbf\u5730\u7edf\u8ba1\u5217\u8868\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u51fa\u73b0\u6b21\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>my_list = [1, 2, 3, 3, 4, 5, 3]<\/p>\n<p>series = pd.Series(my_list)<\/p>\n<p>print(series.value_counts())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>value_counts()<\/code> \u65b9\u6cd5\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u5143\u7d20\u53ca\u5176\u51fa\u73b0\u6b21\u6570\u7684Series\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u4f7f\u7528\u9012\u5f52\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u6b64\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528\u9012\u5f52\u7684\u65b9\u6cd5\u6765\u7edf\u8ba1\u5217\u8868\u4e2d\u6570\u636e\u7684\u4e2a\u6570\u3002\u9012\u5f52\u65b9\u6cd5\u867d\u7136\u4e0d\u5982\u524d\u9762\u51e0\u79cd\u65b9\u6cd5\u9ad8\u6548\uff0c\u4f46\u5bf9\u4e8e\u7406\u89e3\u9012\u5f52\u7684\u6982\u5ff5\u6709\u4e00\u5b9a\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def count_list(lst):<\/p>\n<p>    if not lst:<\/p>\n<p>        return 0<\/p>\n<p>    return 1 + count_list(lst[1:])<\/p>\n<p>my_list = [1, 2, 3, 4, 5, 6]<\/p>\n<p>print(count_list(my_list))  # \u8f93\u51fa: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>count_list()<\/code> \u51fd\u6570\u901a\u8fc7\u9012\u5f52\u8c03\u7528\u81ea\u5df1\u6765\u7edf\u8ba1\u5217\u8868\u4e2d\u5143\u7d20\u7684\u4e2a\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u516b\u3001\u4f7f\u7528reduce\u51fd\u6570<\/h3>\n<\/p>\n<p><p>Python \u7684 <code>functools<\/code> \u6a21\u5757\u63d0\u4f9b\u4e86 <code>reduce()<\/code> \u51fd\u6570\uff0c\u53ef\u4ee5\u5c06\u4e00\u4e2a\u51fd\u6570\u4f5c\u7528\u4e8e\u4e00\u4e2a\u5e8f\u5217\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u5c06\u7ed3\u679c\u7ee7\u7eed\u4e0e\u4e0b\u4e00\u4e2a\u5143\u7d20\u7d2f\u8ba1\u3002\u6211\u4eec\u53ef\u4ee5\u5229\u7528 <code>reduce()<\/code> \u6765\u7edf\u8ba1\u5217\u8868\u4e2d\u5143\u7d20\u7684\u4e2a\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from functools import reduce<\/p>\n<p>my_list = [1, 2, 3, 4, 5, 6]<\/p>\n<p>count = reduce(lambda x, y: x + 1, my_list, 0)<\/p>\n<p>print(count)  # \u8f93\u51fa: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>reduce()<\/code> \u51fd\u6570\u5c06 <code>lambda<\/code> \u8868\u8fbe\u5f0f\u4f5c\u7528\u4e8e\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u5c06\u7d2f\u8ba1\u7ed3\u679c\u8fd4\u56de\u3002<\/p>\n<\/p>\n<p><h3>\u4e5d\u3001\u4f7f\u7528map\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>map()<\/code> \u51fd\u6570\u53ef\u4ee5\u5c06\u4e00\u4e2a\u51fd\u6570\u4f5c\u7528\u4e8e\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\u3002\u6211\u4eec\u53ef\u4ee5\u7ed3\u5408 <code>sum()<\/code> \u51fd\u6570\u6765\u7edf\u8ba1\u5217\u8868\u4e2d\u7684\u5143\u7d20\u4e2a\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">my_list = [1, 2, 3, 4, 5, 6]<\/p>\n<p>count = sum(map(lambda x: 1, my_list))<\/p>\n<p>print(count)  # \u8f93\u51fa: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>map()<\/code> \u51fd\u6570\u5c06 <code>lambda<\/code> \u8868\u8fbe\u5f0f\u4f5c\u7528\u4e8e\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u901a\u8fc7 <code>sum()<\/code> \u51fd\u6570\u7edf\u8ba1\u603b\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u3001\u7edf\u8ba1\u591a\u7ef4\u5217\u8868\u7684\u6570\u636e\u4e2a\u6570<\/h3>\n<\/p>\n<p><p>\u5f53\u6211\u4eec\u5904\u7406\u591a\u7ef4\u5217\u8868\u65f6\uff0c\u7edf\u8ba1\u5143\u7d20\u4e2a\u6570\u53d8\u5f97\u7a0d\u5fae\u590d\u6742\u4e00\u4e9b\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u9012\u5f52\u51fd\u6570\u6765\u7edf\u8ba1\u591a\u7ef4\u5217\u8868\u4e2d\u7684\u5143\u7d20\u4e2a\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def count_elements(lst):<\/p>\n<p>    count = 0<\/p>\n<p>    for element in lst:<\/p>\n<p>        if isinstance(element, list):<\/p>\n<p>            count += count_elements(element)<\/p>\n<p>        else:<\/p>\n<p>            count += 1<\/p>\n<p>    return count<\/p>\n<p>my_list = [1, [2, 3, [4, 5]], 6]<\/p>\n<p>print(count_elements(my_list))  # \u8f93\u51fa: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c<code>count_elements()<\/code> \u51fd\u6570\u901a\u8fc7\u9012\u5f52\u904d\u5386\u591a\u7ef4\u5217\u8868\uff0c\u7edf\u8ba1\u6240\u6709\u5143\u7d20\u7684\u4e2a\u6570\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u591a\u79cd\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u7075\u6d3b\u5730\u7edf\u8ba1Python\u5217\u8868\u4e2d\u7684\u6570\u636e\u4e2a\u6570\u3002\u6839\u636e\u5b9e\u9645\u9700\u6c42\u548c\u5177\u4f53\u573a\u666f\uff0c\u9009\u62e9\u9002\u5408\u7684\u65b9\u6cd5\u5c06\u4f7f\u6211\u4eec\u7684\u4ee3\u7801\u66f4\u52a0\u9ad8\u6548\u548c\u7b80\u6d01\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u7edf\u8ba1\u5217\u8868\u4e2d\u67d0\u4e2a\u7279\u5b9a\u5143\u7d20\u7684\u51fa\u73b0\u6b21\u6570\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>list.count()<\/code>\u65b9\u6cd5\u6765\u7edf\u8ba1\u5217\u8868\u4e2d\u7279\u5b9a\u5143\u7d20\u7684\u51fa\u73b0\u6b21\u6570\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u6709\u4e00\u4e2a\u5217\u8868<code>my_list = [1, 2, 3, 1, 4, 1]<\/code>\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>my_list.count(1)<\/code>\u6765\u83b7\u53d6\u6570\u5b571\u7684\u51fa\u73b0\u6b21\u6570\uff0c\u7ed3\u679c\u5c06\u662f3\u3002<\/p>\n<p><strong>\u6709\u6ca1\u6709\u5176\u4ed6\u65b9\u6cd5\u53ef\u4ee5\u7edf\u8ba1\u5217\u8868\u4e2d\u6240\u6709\u5143\u7d20\u7684\u51fa\u73b0\u6b21\u6570\uff1f<\/strong><br \/>\u5f53\u7136\u53ef\u4ee5\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>collections<\/code>\u6a21\u5757\u4e2d\u7684<code>Counter<\/code>\u7c7b\u6765\u5feb\u901f\u7edf\u8ba1\u5217\u8868\u4e2d\u6240\u6709\u5143\u7d20\u7684\u51fa\u73b0\u6b21\u6570\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">from collections import Counter\n\nmy_list = [1, 2, 3, 1, 4, 1]\ncount_result = Counter(my_list)\nprint(count_result)\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u8fd4\u56de\u4e00\u4e2a\u5b57\u5178\uff0c\u663e\u793a\u6bcf\u4e2a\u5143\u7d20\u53ca\u5176\u51fa\u73b0\u7684\u6b21\u6570\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u7edf\u8ba1\u8fc7\u7a0b\u4e2d\u6392\u9664\u67d0\u4e9b\u7279\u5b9a\u7684\u5143\u7d20\uff1f<\/strong><br \/>\u5728\u7edf\u8ba1\u5217\u8868\u4e2d\u6570\u636e\u4e2a\u6570\u65f6\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5217\u8868\u63a8\u5bfc\u5f0f\u6765\u6392\u9664\u7279\u5b9a\u7684\u5143\u7d20\u3002\u5047\u8bbe\u60a8\u5e0c\u671b\u7edf\u8ba1<code>my_list = [1, 2, 3, 1, 4, 1]<\/code>\u4e2d\u6240\u6709\u6570\u5b571\u4ee5\u5916\u7684\u5143\u7d20\u51fa\u73b0\u6b21\u6570\uff0c\u53ef\u4ee5\u8fd9\u6837\u505a\uff1a<\/p>\n<pre><code class=\"language-python\">filtered_list = [x for x in my_list if x != 1]\ncount_result = Counter(filtered_list)\nprint(count_result)\n<\/code><\/pre>\n<p>\u8fd9\u6837\uff0c\u60a8\u5c06\u5f97\u5230\u4e00\u4e2a\u53ea\u5305\u542b\u5176\u4ed6\u5143\u7d20\u53ca\u5176\u51fa\u73b0\u6b21\u6570\u7684\u7edf\u8ba1\u7ed3\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u7edf\u8ba1\u5217\u8868\u4e2d\u6570\u636e\u7684\u4e2a\u6570 \u5728Python\u4e2d\uff0c\u7edf\u8ba1\u5217\u8868\u4e2d\u6570\u636e\u7684\u4e2a\u6570\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u51fd\u6570\u3001\u5faa [&hellip;]","protected":false},"author":3,"featured_media":1069254,"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\/1069244"}],"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=1069244"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1069244\/revisions"}],"predecessor-version":[{"id":1069255,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1069244\/revisions\/1069255"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1069254"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1069244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1069244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1069244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}