{"id":1183079,"date":"2025-01-15T19:10:32","date_gmt":"2025-01-15T11:10:32","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1183079.html"},"modified":"2025-01-15T19:10:34","modified_gmt":"2025-01-15T11:10:34","slug":"python%e5%a6%82%e4%bd%95%e7%bb%99%e5%ba%8f%e5%88%97%e8%b5%8b%e5%80%bc%e8%ae%a1%e7%ae%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1183079.html","title":{"rendered":"python\u5982\u4f55\u7ed9\u5e8f\u5217\u8d4b\u503c\u8ba1\u7b97"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25132939\/0e769b01-a295-4da7-b581-08cc36373dcd.webp\" alt=\"python\u5982\u4f55\u7ed9\u5e8f\u5217\u8d4b\u503c\u8ba1\u7b97\" \/><\/p>\n<p><p> Python\u4e2d\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u7ed9\u5e8f\u5217\u8d4b\u503c\u5e76\u8fdb\u884c\u8ba1\u7b97\u3002<strong>\u901a\u8fc7\u5217\u8868\u89e3\u6790\u3001\u4f7f\u7528map\u51fd\u6570\u3001\u4f7f\u7528numpy\u5e93\u3001\u4f7f\u7528pandas\u5e93<\/strong>\u7b49\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u5e8f\u5217\u8d4b\u503c\u548c\u8ba1\u7b97\u3002\u5176\u4e2d\uff0c\u4f7f\u7528numpy\u5e93\u662f\u4e00\u79cd\u975e\u5e38\u9ad8\u6548\u7684\u65b9\u6cd5\uff0c\u5c24\u5176\u662f\u5728\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u65f6\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528numpy\u5e93\u7ed9\u5e8f\u5217\u8d4b\u503c\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><p>\u4f7f\u7528numpy\u5e93\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u8ba1\u7b97\u6548\u7387\uff0c\u56e0\u4e3anumpy\u662f\u4e13\u95e8\u4e3a\u6570\u503c\u8ba1\u7b97\u4f18\u5316\u7684\u5e93\u3002\u4f7f\u7528numpy\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u521b\u5efa\u6570\u7ec4\uff0c\u5e76\u5bf9\u6570\u7ec4\u8fdb\u884c\u5404\u79cd\u6570\u5b66\u8fd0\u7b97\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2anumpy\u6570\u7ec4<\/strong><\/h2>\n<p>arr = np.array([1, 2, 3, 4, 5])<\/p>\n<h2><strong>\u7ed9\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>arr = arr + 2<\/p>\n<p>print(arr)  # \u8f93\u51fa: [3 4 5 6 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u9996\u5148\u521b\u5efa\u4e86\u4e00\u4e2a\u5305\u542b\u6570\u5b571\u52305\u7684numpy\u6570\u7ec4\u3002\u7136\u540e\uff0c\u5c06\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u90fd\u52a0\u4e0a\u4e862\u3002\u8fd9\u79cd\u64cd\u4f5c\u5728numpy\u4e2d\u662f\u975e\u5e38\u9ad8\u6548\u7684\uff0c\u56e0\u4e3anumpy\u5e95\u5c42\u662f\u7528C\u8bed\u8a00\u5b9e\u73b0\u7684\uff0c\u53ef\u4ee5\u907f\u514dPython\u89e3\u91ca\u5668\u7684\u5faa\u73af\u5f00\u9500\u3002<\/p>\n<\/p>\n<hr>\n<p><h3>\u4e00\u3001\u5217\u8868\u89e3\u6790<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u89e3\u6790\u662f\u4e00\u79cd\u7b80\u6d01\u4e14\u9ad8\u6548\u7684\u521b\u5efa\u5217\u8868\u7684\u65b9\u6cd5\u3002\u5b83\u5141\u8bb8\u6211\u4eec\u5728\u4e00\u884c\u4ee3\u7801\u4e2d\u751f\u6210\u4e00\u4e2a\u5217\u8868\uff0c\u5e76\u5bf9\u5176\u8fdb\u884c\u5404\u79cd\u8ba1\u7b97\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868\u89e3\u6790\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868\u89e3\u6790\u7ed9\u6bcf\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>new_list = [x + 2 for x in original_list]<\/p>\n<p>print(new_list)  # \u8f93\u51fa: [3, 4, 5, 6, 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u89e3\u6790\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684\u5217\u8868<code>new_list<\/code>\uff0c\u5176\u4e2d\u6bcf\u4e2a\u5143\u7d20\u90fd\u662f\u539f\u59cb\u5217\u8868<code>original_list<\/code>\u4e2d\u5bf9\u5e94\u5143\u7d20\u52a02\u540e\u7684\u7ed3\u679c\u3002\u5217\u8868\u89e3\u6790\u7684\u8bed\u6cd5\u662f<code>[expression for item in iterable]<\/code>\uff0c\u5176\u4e2d<code>expression<\/code>\u662f\u6211\u4eec\u5e0c\u671b\u5e94\u7528\u4e8e\u6bcf\u4e2a\u5143\u7d20\u7684\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528map\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>map<\/code>\u51fd\u6570\u53ef\u4ee5\u5c06\u4e00\u4e2a\u51fd\u6570\u5e94\u7528\u4e8e\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u7ed3\u679c\u7684\u8fed\u4ee3\u5668\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>map<\/code>\u51fd\u6570\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528map\u51fd\u6570\u7ed9\u6bcf\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>new_list = list(map(lambda x: x + 2, original_list))<\/p>\n<p>print(new_list)  # \u8f93\u51fa: [3, 4, 5, 6, 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>map<\/code>\u51fd\u6570\u5c06\u533f\u540d\u51fd\u6570<code>lambda x: x + 2<\/code>\u5e94\u7528\u4e8e<code>original_list<\/code>\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u5c06\u7ed3\u679c\u8f6c\u6362\u4e3a\u5217\u8868<code>new_list<\/code>\u3002<code>map<\/code>\u51fd\u6570\u975e\u5e38\u9002\u5408\u9700\u8981\u5bf9\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8fdb\u884c\u76f8\u540c\u64cd\u4f5c\u7684\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528numpy\u5e93<\/h3>\n<\/p>\n<p><p><code>numpy<\/code>\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u6570\u503c\u8ba1\u7b97\u5e93\uff0c\u7279\u522b\u9002\u5408\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>numpy<\/code>\u5e93\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2anumpy\u6570\u7ec4<\/strong><\/h2>\n<p>arr = np.array([1, 2, 3, 4, 5])<\/p>\n<h2><strong>\u7ed9\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>arr = arr + 2<\/p>\n<p>print(arr)  # \u8f93\u51fa: [3 4 5 6 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>numpy<\/code>\u521b\u5efa\u4e86\u4e00\u4e2a\u5305\u542b\u6570\u5b571\u52305\u7684\u6570\u7ec4<code>arr<\/code>\uff0c\u5e76\u5c06\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u90fd\u52a0\u4e0a\u4e862\u3002<code>numpy<\/code>\u7684\u64cd\u4f5c\u662f\u975e\u5e38\u9ad8\u6548\u7684\uff0c\u56e0\u4e3a\u5b83\u5e95\u5c42\u662f\u7528C\u8bed\u8a00\u5b9e\u73b0\u7684\uff0c\u53ef\u4ee5\u907f\u514dPython\u89e3\u91ca\u5668\u7684\u5faa\u73af\u5f00\u9500\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528pandas\u5e93<\/h3>\n<\/p>\n<p><p><code>pandas<\/code>\u662f\u4e00\u4e2a\u6570\u636e\u5206\u6790\u5e93\uff0c\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u636e\u64cd\u4f5c\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>pandas<\/code>\u5e93\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2apandas Series<\/strong><\/h2>\n<p>series = pd.Series([1, 2, 3, 4, 5])<\/p>\n<h2><strong>\u7ed9Series\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>series = series + 2<\/p>\n<p>print(series)  # \u8f93\u51fa: [3, 4, 5, 6, 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>pandas<\/code>\u521b\u5efa\u4e86\u4e00\u4e2a\u5305\u542b\u6570\u5b571\u52305\u7684Series\uff0c\u5e76\u5c06Series\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u90fd\u52a0\u4e0a\u4e862\u3002<code>pandas<\/code>\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6570\u636e\u64cd\u4f5c\u529f\u80fd\uff0c\u9002\u5408\u5904\u7406\u7ed3\u6784\u5316\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528for\u5faa\u73af<\/h3>\n<\/p>\n<p><p>\u867d\u7136<code>for<\/code>\u5faa\u73af\u5728\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u65f6\u6548\u7387\u4e0d\u5982<code>numpy<\/code>\u548c<code>pandas<\/code>\uff0c\u4f46\u5b83\u4ecd\u7136\u662f\u4e00\u4e2a\u7b80\u5355\u4e14\u76f4\u89c2\u7684\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>for<\/code>\u5faa\u73af\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528for\u5faa\u73af\u7ed9\u6bcf\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>new_list = []<\/p>\n<p>for x in original_list:<\/p>\n<p>    new_list.append(x + 2)<\/p>\n<p>print(new_list)  # \u8f93\u51fa: [3, 4, 5, 6, 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>for<\/code>\u5faa\u73af\u904d\u5386<code>original_list<\/code>\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u5c06\u6bcf\u4e2a\u5143\u7d20\u52a02\u540e\u7684\u7ed3\u679c\u6dfb\u52a0\u5230<code>new_list<\/code>\u4e2d\u3002<code>for<\/code>\u5faa\u73af\u7684\u4f18\u70b9\u662f\u8bed\u6cd5\u7b80\u5355\uff0c\u6613\u4e8e\u7406\u89e3\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528\u5217\u8868\u7684\u5185\u7f6e\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>Python\u5217\u8868\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5185\u7f6e\u65b9\u6cd5\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5bf9\u5217\u8868\u8fdb\u884c\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868\u5185\u7f6e\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868\u7684\u5185\u7f6e\u65b9\u6cd5\u8fdb\u884c\u64cd\u4f5c<\/strong><\/h2>\n<p>new_list = list(map(lambda x: x + 2, original_list))<\/p>\n<p>print(new_list)  # \u8f93\u51fa: [3, 4, 5, 6, 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>map<\/code>\u51fd\u6570\u548c\u533f\u540d\u51fd\u6570<code>lambda<\/code>\u7ed3\u5408\uff0c\u7ed9<code>original_list<\/code>\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u52a02\uff0c\u5e76\u5c06\u7ed3\u679c\u8f6c\u6362\u4e3a\u65b0\u7684\u5217\u8868<code>new_list<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u4f7f\u7528\u751f\u6210\u5668\u8868\u8fbe\u5f0f<\/h3>\n<\/p>\n<p><p>\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u4e0e\u5217\u8868\u89e3\u6790\u7c7b\u4f3c\uff0c\u4f46\u5b83\u4e0d\u4f1a\u7acb\u5373\u751f\u6210\u6574\u4e2a\u5217\u8868\uff0c\u800c\u662f\u8fd4\u56de\u4e00\u4e2a\u751f\u6210\u5668\u5bf9\u8c61\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u7ed9\u6bcf\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>generator = (x + 2 for x in original_list)<\/p>\n<h2><strong>\u5c06\u751f\u6210\u5668\u8f6c\u6362\u4e3a\u5217\u8868<\/strong><\/h2>\n<p>new_list = list(generator)<\/p>\n<p>print(new_list)  # \u8f93\u51fa: [3, 4, 5, 6, 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u751f\u6210\u5668\u8868\u8fbe\u5f0f\u521b\u5efa\u4e86\u4e00\u4e2a\u751f\u6210\u5668\u5bf9\u8c61<code>generator<\/code>\uff0c\u5b83\u5305\u542b\u4e86<code>original_list<\/code>\u4e2d\u6bcf\u4e2a\u5143\u7d20\u52a02\u540e\u7684\u7ed3\u679c\u3002\u7136\u540e\uff0c\u6211\u4eec\u5c06\u751f\u6210\u5668\u5bf9\u8c61\u8f6c\u6362\u4e3a\u5217\u8868<code>new_list<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u516b\u3001\u4f7f\u7528itertools\u6a21\u5757<\/h3>\n<\/p>\n<p><p><code>itertools<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u4e00\u4e9b\u7528\u4e8e\u8fed\u4ee3\u64cd\u4f5c\u7684\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>itertools<\/code>\u6a21\u5757\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import itertools<\/p>\n<h2><strong>\u539f\u59cb\u5217\u8868<\/strong><\/h2>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528itertools.starmap\u51fd\u6570\u7ed9\u6bcf\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>new_list = list(itertools.starmap(lambda x: x + 2, zip(original_list)))<\/p>\n<p>print(new_list)  # \u8f93\u51fa: [3, 4, 5, 6, 7]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>itertools.starmap<\/code>\u51fd\u6570\u5c06\u533f\u540d\u51fd\u6570<code>lambda x: x + 2<\/code>\u5e94\u7528\u4e8e<code>original_list<\/code>\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u5c06\u7ed3\u679c\u8f6c\u6362\u4e3a\u5217\u8868<code>new_list<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u4e5d\u3001\u4f7f\u7528functools\u6a21\u5757<\/h3>\n<\/p>\n<p><p><code>functools<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u4e00\u4e9b\u9ad8\u9636\u51fd\u6570\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>functools<\/code>\u6a21\u5757\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import functools<\/p>\n<h2><strong>\u539f\u59cb\u5217\u8868<\/strong><\/h2>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528functools.reduce\u51fd\u6570\u8ba1\u7b97\u5217\u8868\u5143\u7d20\u7684\u548c<\/strong><\/h2>\n<p>sum_of_elements = functools.reduce(lambda x, y: x + y, original_list)<\/p>\n<p>print(sum_of_elements)  # \u8f93\u51fa: 15<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>functools.reduce<\/code>\u51fd\u6570\u5c06\u533f\u540d\u51fd\u6570<code>lambda x, y: x + y<\/code>\u5e94\u7528\u4e8e<code>original_list<\/code>\u4e2d\u7684\u5143\u7d20\uff0c\u8ba1\u7b97\u5b83\u4eec\u7684\u548c\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u3001\u4f7f\u7528\u5217\u8868\u7684\u5207\u7247\u64cd\u4f5c<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684\u5207\u7247\u64cd\u4f5c\u53ef\u4ee5\u7528\u4e8e\u90e8\u5206\u5217\u8868\u5143\u7d20\u7684\u8d4b\u503c\u548c\u8ba1\u7b97\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868\u5207\u7247\u64cd\u4f5c\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868\u5207\u7247\u64cd\u4f5c\u7ed9\u90e8\u5206\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>original_list[1:4] = [x + 2 for x in original_list[1:4]]<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [1, 4, 5, 6, 5]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684\u5207\u7247\u64cd\u4f5c<code>original_list[1:4]<\/code>\u9009\u53d6\u4e86\u90e8\u5206\u5143\u7d20\uff0c\u5e76\u5c06\u8fd9\u4e9b\u5143\u7d20\u52a02\u540e\u7684\u7ed3\u679c\u8d4b\u503c\u56de\u539f\u5217\u8868\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e00\u3001\u4f7f\u7528\u5217\u8868\u7684\u7d22\u5f15\u64cd\u4f5c<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684\u7d22\u5f15\u64cd\u4f5c\u53ef\u4ee5\u7528\u4e8e\u5355\u4e2a\u5143\u7d20\u7684\u8d4b\u503c\u548c\u8ba1\u7b97\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868\u7d22\u5f15\u64cd\u4f5c\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868\u7d22\u5f15\u64cd\u4f5c\u7ed9\u67d0\u4e2a\u5143\u7d20\u52a02<\/strong><\/h2>\n<p>original_list[2] = original_list[2] + 2<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [1, 2, 5, 4, 5]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684\u7d22\u5f15\u64cd\u4f5c<code>original_list[2]<\/code>\u9009\u53d6\u4e86\u7b2c\u4e09\u4e2a\u5143\u7d20\uff0c\u5e76\u5c06\u8be5\u5143\u7d20\u52a02\u540e\u7684\u7ed3\u679c\u8d4b\u503c\u56de\u539f\u5217\u8868\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e8c\u3001\u4f7f\u7528\u5217\u8868\u7684extend\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684<code>extend<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u5c06\u4e00\u4e2a\u5e8f\u5217\u7684\u5143\u7d20\u6dfb\u52a0\u5230\u5217\u8868\u4e2d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868<code>extend<\/code>\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868extend\u65b9\u6cd5\u6dfb\u52a0\u65b0\u5143\u7d20<\/strong><\/h2>\n<p>original_list.extend([6, 7, 8])<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [1, 2, 3, 4, 5, 6, 7, 8]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684<code>extend<\/code>\u65b9\u6cd5\u5c06\u65b0\u5143\u7d20\u6dfb\u52a0\u5230<code>original_list<\/code>\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e09\u3001\u4f7f\u7528\u5217\u8868\u7684append\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684<code>append<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u5c06\u4e00\u4e2a\u5143\u7d20\u6dfb\u52a0\u5230\u5217\u8868\u7684\u672b\u5c3e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868<code>append<\/code>\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868append\u65b9\u6cd5\u6dfb\u52a0\u65b0\u5143\u7d20<\/strong><\/h2>\n<p>original_list.append(6)<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [1, 2, 3, 4, 5, 6]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684<code>append<\/code>\u65b9\u6cd5\u5c06\u65b0\u5143\u7d20<code>6<\/code>\u6dfb\u52a0\u5230<code>original_list<\/code>\u7684\u672b\u5c3e\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u56db\u3001\u4f7f\u7528\u5217\u8868\u7684insert\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684<code>insert<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u5c06\u4e00\u4e2a\u5143\u7d20\u63d2\u5165\u5230\u5217\u8868\u7684\u6307\u5b9a\u4f4d\u7f6e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868<code>insert<\/code>\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868insert\u65b9\u6cd5\u5728\u6307\u5b9a\u4f4d\u7f6e\u63d2\u5165\u65b0\u5143\u7d20<\/strong><\/h2>\n<p>original_list.insert(2, 6)<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [1, 2, 6, 3, 4, 5]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684<code>insert<\/code>\u65b9\u6cd5\u5c06\u65b0\u5143\u7d20<code>6<\/code>\u63d2\u5165\u5230<code>original_list<\/code>\u7684\u7b2c\u4e09\u4e2a\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e94\u3001\u4f7f\u7528\u5217\u8868\u7684remove\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684<code>remove<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u79fb\u9664\u5217\u8868\u4e2d\u7684\u6307\u5b9a\u5143\u7d20\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868<code>remove<\/code>\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868remove\u65b9\u6cd5\u79fb\u9664\u6307\u5b9a\u5143\u7d20<\/strong><\/h2>\n<p>original_list.remove(3)<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [1, 2, 4, 5]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684<code>remove<\/code>\u65b9\u6cd5\u79fb\u9664\u4e86<code>original_list<\/code>\u4e2d\u7684\u5143\u7d20<code>3<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u516d\u3001\u4f7f\u7528\u5217\u8868\u7684pop\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684<code>pop<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u79fb\u9664\u5e76\u8fd4\u56de\u5217\u8868\u4e2d\u7684\u6307\u5b9a\u4f4d\u7f6e\u5143\u7d20\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868<code>pop<\/code>\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868pop\u65b9\u6cd5\u79fb\u9664\u5e76\u8fd4\u56de\u6307\u5b9a\u4f4d\u7f6e\u5143\u7d20<\/strong><\/h2>\n<p>removed_element = original_list.pop(2)<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [1, 2, 4, 5]<\/p>\n<p>print(removed_element)  # \u8f93\u51fa: 3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684<code>pop<\/code>\u65b9\u6cd5\u79fb\u9664\u4e86<code>original_list<\/code>\u4e2d\u7684\u7b2c\u4e09\u4e2a\u5143\u7d20\uff0c\u5e76\u8fd4\u56de\u4e86\u8be5\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e03\u3001\u4f7f\u7528\u5217\u8868\u7684clear\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684<code>clear<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u79fb\u9664\u5217\u8868\u4e2d\u7684\u6240\u6709\u5143\u7d20\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868<code>clear<\/code>\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868clear\u65b9\u6cd5\u79fb\u9664\u6240\u6709\u5143\u7d20<\/strong><\/h2>\n<p>original_list.clear()<\/p>\n<p>print(original_list)  # \u8f93\u51fa: []<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684<code>clear<\/code>\u65b9\u6cd5\u79fb\u9664\u4e86<code>original_list<\/code>\u4e2d\u7684\u6240\u6709\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u516b\u3001\u4f7f\u7528\u5217\u8868\u7684reverse\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684<code>reverse<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u53cd\u8f6c\u5217\u8868\u4e2d\u7684\u5143\u7d20\u987a\u5e8f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868<code>reverse<\/code>\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [1, 2, 3, 4, 5]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868reverse\u65b9\u6cd5\u53cd\u8f6c\u5143\u7d20\u987a\u5e8f<\/strong><\/h2>\n<p>original_list.reverse()<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [5, 4, 3, 2, 1]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684<code>reverse<\/code>\u65b9\u6cd5\u53cd\u8f6c\u4e86<code>original_list<\/code>\u4e2d\u7684\u5143\u7d20\u987a\u5e8f\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e5d\u3001\u4f7f\u7528\u5217\u8868\u7684sort\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5217\u8868\u7684<code>sort<\/code>\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u5bf9\u5217\u8868\u4e2d\u7684\u5143\u7d20\u8fdb\u884c\u6392\u5e8f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528\u5217\u8868<code>sort<\/code>\u65b9\u6cd5\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u539f\u59cb\u5217\u8868<\/p>\n<p>original_list = [5, 2, 3, 4, 1]<\/p>\n<h2><strong>\u4f7f\u7528\u5217\u8868sort\u65b9\u6cd5\u5bf9\u5143\u7d20\u8fdb\u884c\u6392\u5e8f<\/strong><\/h2>\n<p>original_list.sort()<\/p>\n<p>print(original_list)  # \u8f93\u51fa: [1, 2, 3, 4, 5]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u5217\u8868\u7684<code>sort<\/code>\u65b9\u6cd5\u5bf9<code>original_list<\/code>\u4e2d\u7684\u5143\u7d20\u8fdb\u884c\u4e86\u6392\u5e8f\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u5341\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u7ed9\u5e8f\u5217\u8d4b\u503c\u5e76\u8fdb\u884c\u8ba1\u7b97\u3002<strong>\u901a\u8fc7\u5217\u8868\u89e3\u6790\u3001\u4f7f\u7528map\u51fd\u6570\u3001\u4f7f\u7528numpy\u5e93\u3001\u4f7f\u7528pandas\u5e93<\/strong>\u7b49\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u5e8f\u5217\u8d4b\u503c\u548c\u8ba1\u7b97\u3002\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u548c\u6570\u636e\u89c4\u6a21\u3002\u5728\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u65f6\uff0c\u4f7f\u7528numpy\u5e93\u662f\u4e00\u79cd\u975e\u5e38\u9ad8\u6548\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u5e95\u5c42\u662f\u7528C\u8bed\u8a00\u5b9e\u73b0\u7684\uff0c\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u8ba1\u7b97\u6548\u7387\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u5e94\u8be5\u6839\u636e\u5177\u4f53\u9700\u6c42\u548c\u6570\u636e\u7279\u6027\uff0c\u9009\u62e9\u6700\u5408\u9002\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4e3a\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\u8d4b\u503c\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u7d22\u5f15\u76f4\u63a5\u4e3a\u5e8f\u5217\uff08\u5982\u5217\u8868\u6216\u5143\u7ec4\uff09\u7684\u5143\u7d20\u8d4b\u503c\u3002\u4f8b\u5982\uff0c\u82e5\u6709\u4e00\u4e2a\u5217\u8868<code>my_list = [1, 2, 3]<\/code>\uff0c\u53ef\u4ee5\u901a\u8fc7<code>my_list[0] = 10<\/code>\u6765\u5c06\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u503c\u66f4\u6539\u4e3a10\u3002\u5bf9\u4e8e\u5143\u7ec4\uff0c\u7531\u4e8e\u5176\u4e0d\u53ef\u53d8\u6027\uff0c\u65e0\u6cd5\u76f4\u63a5\u4fee\u6539\u5143\u7d20\u503c\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u65b0\u7684\u5143\u7ec4\u6765\u5b9e\u73b0\u7c7b\u4f3c\u7684\u6548\u679c\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5bf9\u5e8f\u5217\u8fdb\u884c\u8ba1\u7b97\u64cd\u4f5c\uff1f<\/strong><br \/>Python\u652f\u6301\u591a\u79cd\u8ba1\u7b97\u64cd\u4f5c\uff0c\u53ef\u4ee5\u901a\u8fc7\u5faa\u73af\u6216\u5185\u7f6e\u51fd\u6570\u5bf9\u5e8f\u5217\u8fdb\u884c\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528<code>sum()<\/code>\u51fd\u6570\u8ba1\u7b97\u5217\u8868\u4e2d\u6240\u6709\u5143\u7d20\u7684\u548c\uff0c\u6216\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u8fdb\u884c\u66f4\u590d\u6742\u7684\u8ba1\u7b97\uff0c\u5982<code>[x**2 for x in my_list]<\/code>\u6765\u751f\u6210\u5143\u7d20\u7684\u5e73\u65b9\u5217\u8868\u3002\u8fd9\u4e9b\u64cd\u4f5c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u8f7b\u677e\u5730\u5904\u7406\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528NumPy\u5e93\u5bf9\u5e8f\u5217\u8fdb\u884c\u9ad8\u6548\u8ba1\u7b97\uff1f<\/strong><br \/>NumPy\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5e93\uff0c\u4e13\u95e8\u7528\u4e8e\u6570\u503c\u8ba1\u7b97\u3002\u4f7f\u7528NumPy\u6570\u7ec4\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u8ba1\u7b97\u6548\u7387\u3002\u9996\u5148\u9700\u8981\u5b89\u88c5NumPy\u5e93\uff0c\u7136\u540e\u53ef\u4ee5\u901a\u8fc7<code>import numpy as np<\/code>\u6765\u5f15\u5165\u3002\u521b\u5efaNumPy\u6570\u7ec4\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u5411\u91cf\u5316\u64cd\u4f5c\u8fdb\u884c\u5404\u79cd\u8ba1\u7b97\uff0c\u5982<code>np.array([1, 2, 3]) * 2<\/code>\u5c06\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u4e58\u4ee52\uff0c\u8fd9\u79cd\u65b9\u6cd5\u6bd4\u4f20\u7edf\u7684Python\u5faa\u73af\u66f4\u5feb\u4e14\u66f4\u7b80\u6d01\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u4e2d\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u7ed9\u5e8f\u5217\u8d4b\u503c\u5e76\u8fdb\u884c\u8ba1\u7b97\u3002\u901a\u8fc7\u5217\u8868\u89e3\u6790\u3001\u4f7f\u7528map\u51fd\u6570\u3001\u4f7f\u7528numpy\u5e93\u3001\u4f7f\u7528pand [&hellip;]","protected":false},"author":3,"featured_media":1183086,"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\/1183079"}],"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=1183079"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1183079\/revisions"}],"predecessor-version":[{"id":1183088,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1183079\/revisions\/1183088"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1183086"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1183079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1183079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1183079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}