{"id":1119129,"date":"2025-01-08T18:41:52","date_gmt":"2025-01-08T10:41:52","guid":{"rendered":""},"modified":"2025-01-08T18:41:55","modified_gmt":"2025-01-08T10:41:55","slug":"python%e5%a6%82%e4%bd%95%e9%87%8d%e5%a4%8d%e5%88%a9%e7%94%a8%e4%b8%80%e7%bb%84%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1119129.html","title":{"rendered":"python\u5982\u4f55\u91cd\u590d\u5229\u7528\u4e00\u7ec4\u6570\u636e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25082340\/fa4f3d56-6338-42a8-aa9c-8bb05bfbc84e.webp\" alt=\"python\u5982\u4f55\u91cd\u590d\u5229\u7528\u4e00\u7ec4\u6570\u636e\" \/><\/p>\n<p><p> <strong>Python \u91cd\u590d\u5229\u7528\u4e00\u7ec4\u6570\u636e\u7684\u51e0\u79cd\u65b9\u6cd5\u5305\u62ec\uff1a\u5217\u8868\u3001\u751f\u6210\u5668\u3001\u8fed\u4ee3\u5668\u3001\u51fd\u6570\u3002<\/strong> <\/p>\n<\/p>\n<p><p>\u5176\u4e2d\uff0c\u5229\u7528\u751f\u6210\u5668\u662f\u4e00\u79cd\u9ad8\u6548\u3001\u4f18\u96c5\u7684\u65b9\u6cd5\u3002\u751f\u6210\u5668\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u8fed\u4ee3\u5668\uff0c\u53ef\u4ee5\u5728\u5faa\u73af\u8fc7\u7a0b\u4e2d\u52a8\u6001\u751f\u6210\u6570\u636e\uff0c\u800c\u4e0d\u662f\u4e00\u6b21\u6027\u5c06\u6240\u6709\u6570\u636e\u4fdd\u5b58\u5728\u5185\u5b58\u4e2d\uff0c\u8fd9\u4f7f\u5f97\u5b83\u7279\u522b\u9002\u7528\u4e8e\u5927\u6570\u636e\u96c6\u3002\u751f\u6210\u5668\u4f7f\u7528 <code>yield<\/code> \u5173\u952e\u5b57\uff0c\u6bcf\u6b21\u8c03\u7528\u751f\u6210\u5668\u65f6\uff0c\u5b83\u4f1a\u8fd4\u56de\u4e00\u4e2a\u503c\uff0c\u5e76\u5728\u4e0b\u6b21\u8c03\u7528\u65f6\u4ece\u4e0a\u6b21\u8fd4\u56de\u7684\u5730\u65b9\u7ee7\u7eed\u6267\u884c\u3002\u8fd9\u6837\u53ef\u4ee5\u8282\u7701\u5185\u5b58\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5217\u8868<\/h3>\n<\/p>\n<p><p>\u5728 Python \u4e2d\uff0c\u5217\u8868\u662f\u4e00\u79cd\u5e38\u7528\u7684\u6570\u636e\u7ed3\u6784\uff0c\u7528\u4e8e\u5b58\u50a8\u4e00\u7ec4\u6709\u5e8f\u7684\u6570\u636e\u3002\u5217\u8868\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u548c\u4fee\u6539\u4efb\u610f\u4f4d\u7f6e\u7684\u5143\u7d20\uff0c\u65b9\u4fbf\u5bf9\u6570\u636e\u8fdb\u884c\u91cd\u590d\u5229\u7528\u3002<\/p>\n<\/p>\n<p><h4>1.1 \u521b\u5efa\u548c\u8bbf\u95ee\u5217\u8868<\/h4>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u5217\u8868\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5c06\u6570\u636e\u653e\u5728\u65b9\u62ec\u53f7\u5185\uff0c\u7528\u9017\u53f7\u5206\u9694\u5373\u53ef\u3002\u8bbf\u95ee\u5217\u8868\u4e2d\u7684\u5143\u7d20\u53ef\u4ee5\u4f7f\u7528\u7d22\u5f15\uff0c\u7d22\u5f15\u4ece 0 \u5f00\u59cb\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u4e00\u4e2a\u5305\u542b\u6570\u5b57\u7684\u5217\u8868<\/p>\n<p>numbers = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u8bbf\u95ee\u5217\u8868\u4e2d\u7684\u5143\u7d20<\/strong><\/h2>\n<p>print(numbers[0])  # \u8f93\u51fa\uff1a1<\/p>\n<p>print(numbers[1])  # \u8f93\u51fa\uff1a2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>1.2 \u4fee\u6539\u5217\u8868<\/h4>\n<\/p>\n<p><p>\u5217\u8868\u662f\u53ef\u53d8\u7684\u6570\u636e\u7ed3\u6784\uff0c\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u5176\u4e2d\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4fee\u6539\u5217\u8868\u4e2d\u7684\u5143\u7d20<\/p>\n<p>numbers[0] = 10<\/p>\n<p>print(numbers)  # \u8f93\u51fa\uff1a[10, 2, 3, 4, 5]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>1.3 \u5217\u8868\u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u5217\u8868\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982 <code>append<\/code>\u3001<code>extend<\/code>\u3001<code>insert<\/code>\u3001<code>remove<\/code>\u3001<code>pop<\/code> \u7b49\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5bf9\u5217\u8868\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6dfb\u52a0\u5143\u7d20\u5230\u5217\u8868\u672b\u5c3e<\/p>\n<p>numbers.append(6)<\/p>\n<p>print(numbers)  # \u8f93\u51fa\uff1a[10, 2, 3, 4, 5, 6]<\/p>\n<h2><strong>\u6269\u5c55\u5217\u8868<\/strong><\/h2>\n<p>numbers.extend([7, 8])<\/p>\n<p>print(numbers)  # \u8f93\u51fa\uff1a[10, 2, 3, 4, 5, 6, 7, 8]<\/p>\n<h2><strong>\u63d2\u5165\u5143\u7d20\u5230\u6307\u5b9a\u4f4d\u7f6e<\/strong><\/h2>\n<p>numbers.insert(1, 20)<\/p>\n<p>print(numbers)  # \u8f93\u51fa\uff1a[10, 20, 2, 3, 4, 5, 6, 7, 8]<\/p>\n<h2><strong>\u79fb\u9664\u5217\u8868\u4e2d\u7684\u5143\u7d20<\/strong><\/h2>\n<p>numbers.remove(20)<\/p>\n<p>print(numbers)  # \u8f93\u51fa\uff1a[10, 2, 3, 4, 5, 6, 7, 8]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u751f\u6210\u5668<\/h3>\n<\/p>\n<p><p>\u751f\u6210\u5668\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u8fed\u4ee3\u5668\uff0c\u53ef\u4ee5\u5728\u5faa\u73af\u8fc7\u7a0b\u4e2d\u52a8\u6001\u751f\u6210\u6570\u636e\uff0c\u800c\u4e0d\u662f\u4e00\u6b21\u6027\u5c06\u6240\u6709\u6570\u636e\u4fdd\u5b58\u5728\u5185\u5b58\u4e2d\u3002\u751f\u6210\u5668\u4f7f\u7528 <code>yield<\/code> \u5173\u952e\u5b57\uff0c\u6bcf\u6b21\u8c03\u7528\u751f\u6210\u5668\u65f6\uff0c\u5b83\u4f1a\u8fd4\u56de\u4e00\u4e2a\u503c\uff0c\u5e76\u5728\u4e0b\u6b21\u8c03\u7528\u65f6\u4ece\u4e0a\u6b21\u8fd4\u56de\u7684\u5730\u65b9\u7ee7\u7eed\u6267\u884c\u3002<\/p>\n<\/p>\n<p><h4>2.1 \u521b\u5efa\u751f\u6210\u5668<\/h4>\n<\/p>\n<p><p>\u521b\u5efa\u751f\u6210\u5668\u6709\u4e24\u79cd\u65b9\u5f0f\uff0c\u4e00\u79cd\u662f\u4f7f\u7528\u751f\u6210\u5668\u51fd\u6570\uff0c\u53e6\u4e00\u79cd\u662f\u4f7f\u7528\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u751f\u6210\u5668\u51fd\u6570<\/p>\n<p>def my_generator():<\/p>\n<p>    for i in range(5):<\/p>\n<p>        yield i<\/p>\n<p>gen = my_generator()<\/p>\n<p>for value in gen:<\/p>\n<p>    print(value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u751f\u6210\u5668\u8868\u8fbe\u5f0f<\/p>\n<p>gen = (i for i in range(5))<\/p>\n<p>for value in gen:<\/p>\n<p>    print(value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2.2 \u751f\u6210\u5668\u7684\u4f18\u70b9<\/h4>\n<\/p>\n<p><p>\u751f\u6210\u5668\u7684\u4f18\u70b9\u5305\u62ec\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u8282\u7701\u5185\u5b58<\/strong>\uff1a\u751f\u6210\u5668\u5728\u6bcf\u6b21\u8fed\u4ee3\u65f6\u52a8\u6001\u751f\u6210\u6570\u636e\uff0c\u800c\u4e0d\u662f\u4e00\u6b21\u6027\u5c06\u6240\u6709\u6570\u636e\u4fdd\u5b58\u5728\u5185\u5b58\u4e2d\uff0c\u8fd9\u4f7f\u5f97\u751f\u6210\u5668\u7279\u522b\u9002\u7528\u4e8e\u5904\u7406\u5927\u6570\u636e\u96c6\u3002<\/li>\n<li><strong>\u63d0\u9ad8\u6027\u80fd<\/strong>\uff1a\u751f\u6210\u5668\u53ef\u4ee5\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u8ba1\u7b97\u548c\u5185\u5b58\u5206\u914d\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u3002<\/li>\n<li><strong>\u4ee3\u7801\u7b80\u6d01<\/strong>\uff1a\u751f\u6210\u5668\u7684\u4ee3\u7801\u901a\u5e38\u6bd4\u4f20\u7edf\u7684\u8fed\u4ee3\u5668\u4ee3\u7801\u66f4\u7b80\u6d01\u3001\u66f4\u6613\u8bfb\u3002<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u8fed\u4ee3\u5668<\/h3>\n<\/p>\n<p><p>\u8fed\u4ee3\u5668\u662f\u4e00\u79cd\u5bf9\u8c61\uff0c\u5b83\u5b9e\u73b0\u4e86\u8fed\u4ee3\u534f\u8bae\uff0c\u5373\u5305\u542b <code>__iter__()<\/code> \u548c <code>__next__()<\/code> \u65b9\u6cd5\u3002\u8fed\u4ee3\u5668\u53ef\u4ee5\u7528\u4e8e\u904d\u5386\u4e00\u7ec4\u6570\u636e\uff0c\u4f46\u4e0e\u751f\u6210\u5668\u4e0d\u540c\u7684\u662f\uff0c\u8fed\u4ee3\u5668\u901a\u5e38\u9700\u8981\u5c06\u6240\u6709\u6570\u636e\u4fdd\u5b58\u5728\u5185\u5b58\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>3.1 \u521b\u5efa\u8fed\u4ee3\u5668<\/h4>\n<\/p>\n<p><p>\u521b\u5efa\u8fed\u4ee3\u5668\u9700\u8981\u5b9a\u4e49\u4e00\u4e2a\u7c7b\uff0c\u5b9e\u73b0 <code>__iter__()<\/code> \u548c <code>__next__()<\/code> \u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyIterator:<\/p>\n<p>    def __init__(self, data):<\/p>\n<p>        self.data = data<\/p>\n<p>        self.index = 0<\/p>\n<p>    def __iter__(self):<\/p>\n<p>        return self<\/p>\n<p>    def __next__(self):<\/p>\n<p>        if self.index &gt;= len(self.data):<\/p>\n<p>            r<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>se StopIteration<\/p>\n<p>        value = self.data[self.index]<\/p>\n<p>        self.index += 1<\/p>\n<p>        return value<\/p>\n<p>data = [1, 2, 3, 4, 5]<\/p>\n<p>it = MyIterator(data)<\/p>\n<p>for value in it:<\/p>\n<p>    print(value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u5728 Python \u4e2d\uff0c\u51fd\u6570\u662f\u4e00\u7b49\u516c\u6c11\uff0c\u53ef\u4ee5\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u5176\u4ed6\u51fd\u6570\uff0c\u6216\u8005\u4ece\u5176\u4ed6\u51fd\u6570\u8fd4\u56de\u3002\u5229\u7528\u51fd\u6570\uff0c\u53ef\u4ee5\u5c06\u4e00\u7ec4\u6570\u636e\u5c01\u88c5\u5728\u51fd\u6570\u5185\u90e8\uff0c\u901a\u8fc7\u8c03\u7528\u51fd\u6570\u6765\u91cd\u590d\u5229\u7528\u8fd9\u4e9b\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>4.1 \u51fd\u6570\u53c2\u6570<\/h4>\n<\/p>\n<p><p>\u51fd\u6570\u53ef\u4ee5\u63a5\u53d7\u53c2\u6570\uff0c\u5c06\u4e00\u7ec4\u6570\u636e\u4f20\u9012\u7ed9\u51fd\u6570\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def process_data(data):<\/p>\n<p>    for value in data:<\/p>\n<p>        print(value)<\/p>\n<p>data = [1, 2, 3, 4, 5]<\/p>\n<p>process_data(data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4.2 \u51fd\u6570\u8fd4\u56de\u503c<\/h4>\n<\/p>\n<p><p>\u51fd\u6570\u53ef\u4ee5\u8fd4\u56de\u4e00\u7ec4\u6570\u636e\uff0c\u901a\u8fc7\u8c03\u7528\u51fd\u6570\u6765\u83b7\u53d6\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def get_data():<\/p>\n<p>    return [1, 2, 3, 4, 5]<\/p>\n<p>data = get_data()<\/p>\n<p>for value in data:<\/p>\n<p>    print(value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728 Python \u4e2d\uff0c\u91cd\u590d\u5229\u7528\u4e00\u7ec4\u6570\u636e\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u5217\u8868\u3001\u751f\u6210\u5668\u3001\u8fed\u4ee3\u5668\u548c\u51fd\u6570\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u70b9\u548c\u9002\u7528\u573a\u666f\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u6027\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5217\u8868<\/strong>\uff1a\u9002\u7528\u4e8e\u5b58\u50a8\u548c\u64cd\u4f5c\u4e00\u7ec4\u6709\u5e8f\u7684\u6570\u636e\uff0c\u65b9\u4fbf\u76f4\u63a5\u8bbf\u95ee\u548c\u4fee\u6539\u4efb\u610f\u4f4d\u7f6e\u7684\u5143\u7d20\u3002<\/li>\n<li><strong>\u751f\u6210\u5668<\/strong>\uff1a\u9002\u7528\u4e8e\u5904\u7406\u5927\u6570\u636e\u96c6\uff0c\u8282\u7701\u5185\u5b58\uff0c\u63d0\u9ad8\u6027\u80fd\uff0c\u4ee3\u7801\u7b80\u6d01\u3002<\/li>\n<li><strong>\u8fed\u4ee3\u5668<\/strong>\uff1a\u9002\u7528\u4e8e\u904d\u5386\u4e00\u7ec4\u6570\u636e\uff0c\u5b9e\u73b0\u81ea\u5b9a\u4e49\u7684\u8fed\u4ee3\u903b\u8f91\u3002<\/li>\n<li><strong>\u51fd\u6570<\/strong>\uff1a\u9002\u7528\u4e8e\u5c06\u6570\u636e\u5c01\u88c5\u5728\u51fd\u6570\u5185\u90e8\uff0c\u901a\u8fc7\u8c03\u7528\u51fd\u6570\u6765\u91cd\u590d\u5229\u7528\u6570\u636e\u3002<\/li>\n<\/ol>\n<p><p>\u6839\u636e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u91cd\u590d\u5229\u7528\u4e00\u7ec4\u6570\u636e\uff0c\u7f16\u5199\u9ad8\u6548\u3001\u4f18\u96c5\u7684 Python \u4ee3\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u6709\u6548\u5730\u91cd\u590d\u4f7f\u7528\u4e00\u7ec4\u6570\u636e\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u91cd\u590d\u5229\u7528\u4e00\u7ec4\u6570\u636e\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u5faa\u73af\u7ed3\u6784\uff08\u5982for\u5faa\u73af\uff09\u6765\u904d\u5386\u6570\u636e\u96c6\uff0c\u6216\u8005\u4f7f\u7528\u6570\u636e\u7ed3\u6784\uff08\u5982\u5217\u8868\u3001\u5b57\u5178\u548c\u96c6\u5408\uff09\u6765\u5b58\u50a8\u6570\u636e\u5e76\u8fdb\u884c\u591a\u6b21\u8bbf\u95ee\u3002\u8fd8\u53ef\u4ee5\u5229\u7528\u51fd\u6570\u6765\u5c06\u4ee3\u7801\u5c01\u88c5\uff0c\u4ece\u800c\u5728\u9700\u8981\u65f6\u91cd\u590d\u8c03\u7528\u3002\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u7ba1\u7406\u548c\u5229\u7528\u6570\u636e\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\uff0c\u6709\u54ea\u4e9b\u5e38\u89c1\u7684\u6570\u636e\u7ed3\u6784\u53ef\u4ee5\u7528\u4e8e\u5b58\u50a8\u548c\u91cd\u590d\u4f7f\u7528\u6570\u636e\uff1f<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u6570\u636e\u7ed3\u6784\u6765\u5b58\u50a8\u548c\u7ba1\u7406\u6570\u636e\uff0c\u5305\u62ec\u5217\u8868\uff08list\uff09\u3001\u5143\u7ec4\uff08tuple\uff09\u3001\u5b57\u5178\uff08dictionary\uff09\u548c\u96c6\u5408\uff08set\uff09\u3002\u5217\u8868\u9002\u5408\u5b58\u50a8\u6709\u5e8f\u7684\u53ef\u53d8\u6570\u636e\uff0c\u5143\u7ec4\u5219\u9002\u5408\u5b58\u50a8\u4e0d\u53ef\u53d8\u7684\u6570\u636e\u3002\u5b57\u5178\u63d0\u4f9b\u4e86\u952e\u503c\u5bf9\u5b58\u50a8\uff0c\u65b9\u4fbf\u5feb\u901f\u67e5\u627e\uff0c\u800c\u96c6\u5408\u7528\u4e8e\u5b58\u50a8\u552f\u4e00\u503c\u3002\u6839\u636e\u9700\u8981\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u7ed3\u6784\uff0c\u53ef\u4ee5\u66f4\u9ad8\u6548\u5730\u91cd\u590d\u5229\u7528\u6570\u636e\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528Python\u7684\u5e93\u6765\u91cd\u590d\u5229\u7528\u6570\u636e\uff0c\u4f8b\u5982NumPy\u6216Pandas\uff1f<\/strong><br \/>NumPy\u548cPandas\u662fPython\u4e2d\u975e\u5e38\u6d41\u884c\u7684\u6570\u636e\u5904\u7406\u5e93\u3002NumPy\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u7ec4\u64cd\u4f5c\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u5bf9\u5927\u89c4\u6a21\u6570\u636e\u8fdb\u884c\u91cd\u590d\u8ba1\u7b97\u3002Pandas\u5219\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5982DataFrame\uff0c\u65b9\u4fbf\u8fdb\u884c\u6570\u636e\u64cd\u4f5c\u548c\u5206\u6790\u3002\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e9b\u5e93\u7684\u5185\u7f6e\u51fd\u6570\uff0c\u5bf9\u6570\u636e\u8fdb\u884c\u7b5b\u9009\u3001\u5206\u7ec4\u548c\u805a\u5408\uff0c\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u7684\u9ad8\u6548\u91cd\u590d\u5229\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python \u91cd\u590d\u5229\u7528\u4e00\u7ec4\u6570\u636e\u7684\u51e0\u79cd\u65b9\u6cd5\u5305\u62ec\uff1a\u5217\u8868\u3001\u751f\u6210\u5668\u3001\u8fed\u4ee3\u5668\u3001\u51fd\u6570\u3002 \u5176\u4e2d\uff0c\u5229\u7528\u751f\u6210\u5668\u662f\u4e00\u79cd\u9ad8\u6548\u3001\u4f18\u96c5\u7684 [&hellip;]","protected":false},"author":3,"featured_media":1119139,"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\/1119129"}],"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=1119129"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119129\/revisions"}],"predecessor-version":[{"id":1119143,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1119129\/revisions\/1119143"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1119139"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1119129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1119129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1119129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}