{"id":953106,"date":"2024-12-27T01:39:43","date_gmt":"2024-12-26T17:39:43","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/953106.html"},"modified":"2024-12-27T01:39:46","modified_gmt":"2024-12-26T17:39:46","slug":"python%e6%95%b0%e7%bb%84%e5%a6%82%e4%bd%95%e8%bd%ac%e7%9f%a9%e9%98%b5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/953106.html","title":{"rendered":"python\u6570\u7ec4\u5982\u4f55\u8f6c\u77e9\u9635"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25090728\/2c966d95-27b9-4602-bbb5-58f769f1a252.webp\" alt=\"python\u6570\u7ec4\u5982\u4f55\u8f6c\u77e9\u9635\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u6570\u7ec4\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528NumPy\u5e93\u4e2d\u7684reshape\u65b9\u6cd5\u3001array\u65b9\u6cd5\u6216\u8005\u901a\u8fc7\u5217\u8868\u89e3\u6790\u7684\u65b9\u5f0f\u8f6c\u6362\u4e3a\u77e9\u9635\u3002NumPy\u5e93\u662f\u5904\u7406\u6570\u7ec4\u548c\u77e9\u9635\u8fd0\u7b97\u7684\u5f3a\u5927\u5de5\u5177\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u51fd\u6570\u548c\u65b9\u6cd5\u6765\u7b80\u5316\u8fd9\u4e9b\u64cd\u4f5c\u3002\u4f7f\u7528NumPy\u7684reshape\u65b9\u6cd5\u53ef\u4ee5\u5c06\u6570\u7ec4\u8f6c\u6362\u4e3a\u6307\u5b9a\u5f62\u72b6\u7684\u77e9\u9635\uff0c\u800carray\u65b9\u6cd5\u53ef\u4ee5\u76f4\u63a5\u5c06\u5d4c\u5957\u5217\u8868\u8f6c\u6362\u4e3a\u77e9\u9635\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528NumPy\u7684reshape\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>NumPy\u662fPython\u4e2d\u8fdb\u884c\u79d1\u5b66\u8ba1\u7b97\u7684\u57fa\u7840\u5e93\uff0c\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u7ec4\u548c\u77e9\u9635\u64cd\u4f5c\u80fd\u529b\u3002\u8981\u5c06\u6570\u7ec4\u8f6c\u6362\u4e3a\u77e9\u9635\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86NumPy\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u4f7f\u7528reshape\u65b9\u6cd5\u5c06\u6570\u7ec4\u8f6c\u6362\u4e3a\u77e9\u9635\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaNumPy\u6570\u7ec4<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5c06\u5217\u8868\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4\u3002\u5047\u8bbe\u6709\u4e00\u4e2a\u4e00\u7ef4\u6570\u7ec4\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528NumPy\u7684<code>array<\/code>\u51fd\u6570\u521b\u5efa\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>array = np.array([1, 2, 3, 4, 5, 6])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528reshape\u8f6c\u6362\u4e3a\u77e9\u9635<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528<code>reshape<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5c06\u4e00\u7ef4\u6570\u7ec4\u8f6c\u6362\u4e3a\u6307\u5b9a\u5f62\u72b6\u7684\u77e9\u9635\u3002\u5047\u8bbe\u6211\u4eec\u5e0c\u671b\u5c06\u4e0a\u8ff0\u6570\u7ec4\u8f6c\u6362\u4e3a2&#215;3\u7684\u77e9\u9635\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">matrix = array.reshape(2, 3)<\/p>\n<p>print(matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u8f93\u51fa\uff1a<\/p>\n<\/p>\n<p><pre><code>[[1 2 3]<\/p>\n<p> [4 5 6]]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u91cd\u70b9\uff1a<\/strong> <code>reshape<\/code>\u65b9\u6cd5\u4e0d\u4f1a\u6539\u53d8\u539f\u6570\u7ec4\u7684\u603b\u5143\u7d20\u4e2a\u6570\uff0c\u56e0\u6b64\u5728\u6307\u5b9a\u65b0\u5f62\u72b6\u65f6\uff0c\u884c\u6570\u548c\u5217\u6570\u7684\u4e58\u79ef\u5fc5\u987b\u7b49\u4e8e\u539f\u6570\u7ec4\u7684\u5143\u7d20\u603b\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528NumPy\u7684array\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p><code>array<\/code>\u65b9\u6cd5\u4e0d\u4ec5\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u4e00\u7ef4\u6570\u7ec4\uff0c\u8fd8\u53ef\u4ee5\u76f4\u63a5\u5c06\u5d4c\u5957\u7684Python\u5217\u8868\u8f6c\u6362\u4e3a\u77e9\u9635\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u76f4\u63a5\u8f6c\u6362\u5217\u8868<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u6570\u636e\u5df2\u7ecf\u662f\u4e00\u4e2a\u5d4c\u5957\u5217\u8868\u5f62\u5f0f\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528<code>array<\/code>\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">nested_list = [[1, 2, 3], [4, 5, 6]]<\/p>\n<p>matrix = np.array(nested_list)<\/p>\n<p>print(matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4f1a\u8f93\u51fa\u76f8\u540c\u76842&#215;3\u77e9\u9635\uff1a<\/p>\n<\/p>\n<p><pre><code>[[1 2 3]<\/p>\n<p> [4 5 6]]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u91cd\u70b9\uff1a<\/strong> \u4f7f\u7528<code>array<\/code>\u65b9\u6cd5\u521b\u5efa\u7684\u77e9\u9635\uff0c\u672c\u8d28\u4e0a\u4ecd\u7136\u662fNumPy\u7684ndarray\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528NumPy\u63d0\u4f9b\u7684\u5404\u79cd\u51fd\u6570\u8fdb\u884c\u77e9\u9635\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u5217\u8868\u89e3\u6790<\/h3>\n<\/p>\n<p><p>\u867d\u7136NumPy\u662f\u5904\u7406\u6570\u7ec4\u548c\u77e9\u9635\u7684\u6807\u51c6\u5de5\u5177\uff0c\u4f46\u5728\u67d0\u4e9b\u7b80\u5355\u573a\u666f\u4e0b\uff0c\u53ef\u4ee5\u901a\u8fc7\u7eafPython\u7684\u5217\u8868\u89e3\u6790\u6765\u5b9e\u73b0\u7c7b\u4f3c\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u624b\u52a8\u8f6c\u6362<\/strong><\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u6709\u4e00\u4e2a\u4e00\u7ef4\u5217\u8868\uff0c\u5e0c\u671b\u5c06\u5176\u8f6c\u6362\u4e3a2&#215;3\u7684\u77e9\u9635\uff0c\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u89e3\u6790\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">list_data = [1, 2, 3, 4, 5, 6]<\/p>\n<p>matrix = [list_data[i:i+3] for i in range(0, len(list_data), 3)]<\/p>\n<p>print(matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code>[[1, 2, 3], [4, 5, 6]]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u91cd\u70b9\uff1a<\/strong> \u5217\u8868\u89e3\u6790\u7684\u65b9\u5f0f\u9002\u5408\u7b80\u5355\u7684\u77e9\u9635\u8f6c\u6362\u64cd\u4f5c\uff0c\u4f46\u5728\u9700\u8981\u8fdb\u884c\u590d\u6742\u77e9\u9635\u8fd0\u7b97\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528NumPy\u5e93\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001NumPy\u77e9\u9635\u64cd\u4f5c\u7684\u4f18\u52bf<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528NumPy\u8fdb\u884c\u77e9\u9635\u64cd\u4f5c\u6709\u8bf8\u591a\u4f18\u52bf\uff0c\u5305\u62ec\u9ad8\u6548\u7684\u5185\u5b58\u7ba1\u7406\u3001\u4e30\u5bcc\u7684\u7ebf\u6027\u4ee3\u6570\u8fd0\u7b97\u652f\u6301\u4ee5\u53ca\u5f3a\u5927\u7684\u6570\u503c\u8ba1\u7b97\u80fd\u529b\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9ad8\u6548\u7684\u5185\u5b58\u7ba1\u7406<\/strong><\/p>\n<\/p>\n<p><p>NumPy\u6570\u7ec4\u5728\u5185\u5b58\u4e2d\u662f\u8fde\u7eed\u5b58\u50a8\u7684\uff0c\u8fd9\u4f7f\u5f97\u5176\u5728\u8fdb\u884c\u5927\u89c4\u6a21\u6570\u636e\u5904\u7406\u65f6\uff0c\u80fd\u591f\u5b9e\u73b0\u66f4\u9ad8\u6548\u7684\u5185\u5b58\u5229\u7528\u548c\u8ba1\u7b97\u901f\u5ea6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e30\u5bcc\u7684\u7ebf\u6027\u4ee3\u6570\u652f\u6301<\/strong><\/p>\n<\/p>\n<p><p>NumPy\u63d0\u4f9b\u4e86\u591a\u79cd\u7ebf\u6027\u4ee3\u6570\u8fd0\u7b97\u529f\u80fd\uff0c\u5982\u77e9\u9635\u4e58\u6cd5\u3001\u9006\u77e9\u9635\u8ba1\u7b97\u3001\u7279\u5f81\u503c\u5206\u89e3\u7b49\uff0c\u8fd9\u4e9b\u529f\u80fd\u5bf9\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5f3a\u5927\u7684\u6570\u503c\u8ba1\u7b97\u80fd\u529b<\/strong><\/p>\n<\/p>\n<p><p>NumPy\u7684\u6570\u503c\u8ba1\u7b97\u80fd\u529b\u4e0d\u4ec5\u9650\u4e8e\u57fa\u672c\u7684\u52a0\u51cf\u4e58\u9664\uff0c\u8fd8\u5305\u62ec\u5bf9\u6570\u3001\u6307\u6570\u3001\u4e09\u89d2\u51fd\u6570\u7b49\u590d\u6742\u6570\u5b66\u8fd0\u7b97\uff0c\u6781\u5927\u5730\u6269\u5c55\u4e86Python\u5728\u79d1\u5b66\u8ba1\u7b97\u9886\u57df\u7684\u5e94\u7528\u8303\u56f4\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u5b9e\u8df5\u6848\u4f8b<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5c06\u6570\u7ec4\u8f6c\u6362\u4e3a\u77e9\u9635\u7684\u64cd\u4f5c\u7ecf\u5e38\u51fa\u73b0\u5728\u6570\u636e\u9884\u5904\u7406\u3001\u56fe\u50cf\u5904\u7406\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u6a21\u578b\u7684\u8f93\u5165\u5904\u7406\u4e2d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u5b9e\u8df5\u6848\u4f8b\uff1a<\/p>\n<\/p>\n<p><p><strong>\u56fe\u50cf\u5904\u7406\u4e2d\u7684\u5e94\u7528<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u56fe\u50cf\u5904\u7406\u4e2d\uff0c\u901a\u5e38\u9700\u8981\u5c06\u56fe\u50cf\u50cf\u7d20\u6570\u636e\u4ece\u4e00\u7ef4\u6570\u7ec4\u8f6c\u6362\u4e3a\u4e8c\u7ef4\u77e9\u9635\u683c\u5f0f\u3002\u4f8b\u5982\uff0c\u5904\u7406\u7070\u5ea6\u56fe\u50cf\u65f6\uff0c\u53ef\u4ee5\u5c06\u4e00\u7ef4\u6570\u7ec4\u8f6c\u6362\u4e3a\u77e9\u9635\u4ee5\u4fbf\u5e94\u7528\u6ee4\u6ce2\u5668\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>from PIL import Image<\/p>\n<h2><strong>\u52a0\u8f7d\u56fe\u50cf\u5e76\u8f6c\u6362\u4e3a\u7070\u5ea6<\/strong><\/h2>\n<p>image = Image.open(&#39;example.jpg&#39;).convert(&#39;L&#39;)<\/p>\n<h2><strong>\u5c06\u56fe\u50cf\u6570\u636e\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4<\/strong><\/h2>\n<p>image_array = np.array(image)<\/p>\n<h2><strong>\u5c55\u793a\u56fe\u50cf\u77e9\u9635<\/strong><\/h2>\n<p>print(image_array)<\/p>\n<h2><strong>\u5047\u8bbe\u9700\u8981\u5c06\u5176\u88c1\u526a\u4e3a100x100\u7684\u533a\u57df<\/strong><\/h2>\n<p>cropped_matrix = image_array[:100, :100]<\/p>\n<p>print(cropped_matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u91cd\u70b9\uff1a<\/strong> \u5728\u56fe\u50cf\u5904\u7406\u7684\u573a\u666f\u4e2d\uff0cNumPy\u7684\u77e9\u9635\u64cd\u4f5c\u53ef\u4ee5\u7b80\u5316\u8bb8\u591a\u590d\u6742\u7684\u56fe\u50cf\u64cd\u4f5c\u6b65\u9aa4\uff0c\u63d0\u9ad8\u6570\u636e\u5904\u7406\u7684\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u4e2d\u5c06\u6570\u7ec4\u8f6c\u6362\u4e3a\u77e9\u9635\u7684\u64cd\u4f5c\u4e3b\u8981\u901a\u8fc7NumPy\u5e93\u5b9e\u73b0\uff0c\u5176\u63d0\u4f9b\u7684<code>reshape<\/code>\u548c<code>array<\/code>\u65b9\u6cd5\u662f\u6700\u5e38\u7528\u7684\u5de5\u5177\u3002\u6b64\u5916\uff0c\u5217\u8868\u89e3\u6790\u53ef\u4ee5\u5728\u7b80\u5355\u573a\u666f\u4e0b\u4f5c\u4e3a\u4e00\u79cd\u66ff\u4ee3\u65b9\u6848\u3002NumPy\u4e0d\u4ec5\u5728\u6570\u636e\u8f6c\u6362\u4e0a\u8868\u73b0\u51fa\u8272\uff0c\u8fd8\u5728\u5185\u5b58\u7ba1\u7406\u3001\u7ebf\u6027\u4ee3\u6570\u652f\u6301\u548c\u6570\u503c\u8ba1\u7b97\u80fd\u529b\u4e0a\u5c55\u73b0\u4e86\u5176\u5f3a\u5927\u7684\u529f\u80fd\u3002\u901a\u8fc7\u5bf9NumPy\u7684\u6df1\u5165\u5b66\u4e60\u548c\u5e94\u7528\uff0c\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u5347\u6570\u636e\u5904\u7406\u548c\u79d1\u5b66\u8ba1\u7b97\u7684\u6548\u7387\uff0c\u4e3a\u590d\u6742\u95ee\u9898\u7684\u89e3\u51b3\u63d0\u4f9b\u6709\u529b\u652f\u6301\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5c06\u4e00\u7ef4\u6570\u7ec4\u8f6c\u6362\u4e3a\u4e8c\u7ef4\u77e9\u9635\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528NumPy\u5e93\u4e2d\u7684<code>reshape<\/code>\u51fd\u6570\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5NumPy\u5e93\uff0c\u7136\u540e\u901a\u8fc7<code>numpy.array<\/code>\u5c06\u4e00\u7ef4\u6570\u7ec4\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4\uff0c\u63a5\u7740\u4f7f\u7528<code>reshape<\/code>\u65b9\u6cd5\u6307\u5b9a\u65b0\u7684\u5f62\u72b6\uff0c\u4f8b\u5982\u5c06\u957f\u5ea6\u4e3a6\u7684\u4e00\u7ef4\u6570\u7ec4\u8f6c\u6362\u4e3a2&#215;3\u7684\u4e8c\u7ef4\u77e9\u9635\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">import numpy as np\n\narray_1d = np.array([1, 2, 3, 4, 5, 6])\nmatrix_2d = array_1d.reshape(2, 3)\nprint(matrix_2d)\n<\/code><\/pre>\n<p><strong>\u53ef\u4ee5\u4f7f\u7528\u54ea\u4e9b\u5e93\u6765\u5b9e\u73b0\u6570\u7ec4\u4e0e\u77e9\u9635\u4e4b\u95f4\u7684\u8f6c\u6362\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0cNumPy\u662f\u6700\u5e38\u7528\u7684\u5e93\u6765\u5904\u7406\u6570\u7ec4\u548c\u77e9\u9635\u3002\u9664\u4e86NumPy\uff0cPandas\u5e93\u4e5f\u63d0\u4f9b\u4e86\u4e00\u4e9b\u529f\u80fd\u6765\u5904\u7406\u6570\u636e\u6846\u548c\u77e9\u9635\u3002\u5982\u679c\u9700\u8981\u6267\u884c\u66f4\u590d\u6742\u7684\u6570\u5b66\u8fd0\u7b97\uff0cSciPy\u5e93\u4e5f\u53ef\u4ee5\u4e0eNumPy\u7ed3\u5408\u4f7f\u7528\uff0c\u63d0\u4f9b\u989d\u5916\u7684\u529f\u80fd\u3002<\/p>\n<p><strong>\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c\u6709\u54ea\u4e9b\u5e38\u89c1\u7684\u9519\u8bef\u9700\u8981\u6ce8\u610f\uff1f<\/strong><br \/>\u8f6c\u6362\u65f6\u5e38\u89c1\u7684\u9519\u8bef\u5305\u62ec\u5f62\u72b6\u4e0d\u5339\u914d\u95ee\u9898\u3002\u5982\u679c\u539f\u59cb\u6570\u7ec4\u7684\u5143\u7d20\u6570\u91cf\u4e0d\u80fd\u88ab\u65b0\u77e9\u9635\u7684\u884c\u5217\u4e58\u79ef\u6574\u9664\uff0c<code>reshape<\/code>\u5c06\u629b\u51fa\u9519\u8bef\u3002\u6b64\u5916\uff0c\u786e\u4fdd\u5728\u8c03\u7528<code>reshape<\/code>\u4e4b\u524d\uff0c\u6570\u7ec4\u5df2\u7ecf\u88ab\u6b63\u786e\u521d\u59cb\u5316\u4e3aNumPy\u6570\u7ec4\uff0c\u4ee5\u514d\u51fa\u73b0\u7c7b\u578b\u9519\u8bef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u6570\u7ec4\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528NumPy\u5e93\u4e2d\u7684reshape\u65b9\u6cd5\u3001array\u65b9\u6cd5\u6216\u8005\u901a\u8fc7\u5217\u8868\u89e3\u6790\u7684\u65b9\u5f0f\u8f6c\u6362 [&hellip;]","protected":false},"author":3,"featured_media":953111,"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\/953106"}],"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=953106"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/953106\/revisions"}],"predecessor-version":[{"id":953115,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/953106\/revisions\/953115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/953111"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=953106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=953106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=953106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}