{"id":1096609,"date":"2025-01-08T15:03:01","date_gmt":"2025-01-08T07:03:01","guid":{"rendered":""},"modified":"2025-01-08T15:03:05","modified_gmt":"2025-01-08T07:03:05","slug":"python-%e4%b8%ad%e5%a6%82%e4%bd%95%e5%86%99%e7%9f%a9%e9%98%b5%e8%bd%ac%e7%bd%ae-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1096609.html","title":{"rendered":"python \u4e2d\u5982\u4f55\u5199\u77e9\u9635\u8f6c\u7f6e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24211741\/f8e52b0d-4990-4199-b84c-0566de8ebe5f.webp\" alt=\"python \u4e2d\u5982\u4f55\u5199\u77e9\u9635\u8f6c\u7f6e\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\u6765\u8fdb\u884c\u77e9\u9635\u7684\u8f6c\u7f6e<\/strong>\uff0c\u5982\u4f7f\u7528\u5d4c\u5957\u5faa\u73af\u3001\u5217\u8868\u63a8\u5bfc\u3001\u4ee5\u53caNumPy\u5e93\u7b49\u3002<strong>\u4f7f\u7528\u5d4c\u5957\u5faa\u73af\u3001\u5217\u8868\u63a8\u5bfc\u548cNumPy\u5e93\u662f\u4e09\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5<\/strong>\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\uff0c\u5373\u4f7f\u7528NumPy\u5e93\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\uff0c\u56e0\u4e3aNumPy\u5e93\u63d0\u4f9b\u4e86\u66f4\u9ad8\u6548\u548c\u7b80\u6d01\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<p><p>NumPy\u5e93\u662fPython\u4e2d\u5904\u7406\u6570\u7ec4\u548c\u77e9\u9635\u7684\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u5e93\uff0c\u5b83\u80fd\u591f\u8f7b\u677e\u5730\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\u7b49\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528NumPy\u5e93\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\u7684\u8be6\u7ec6\u6b65\u9aa4\u548c\u793a\u4f8b\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u5b89\u88c5\u548c\u5bfc\u5165NumPy\u5e93<\/h2>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5\u5e76\u5bfc\u5165NumPy\u5e93\u3002\u5982\u679c\u5c1a\u672a\u5b89\u88c5NumPy\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\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\u5728Python\u811a\u672c\u4e2d\u5bfc\u5165NumPy\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e8c\u3001\u521b\u5efa\u77e9\u9635<\/h2>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\u4e4b\u524d\uff0c\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u77e9\u9635\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528NumPy\u5e93\u521b\u5efa\u4e8c\u7ef4\u77e9\u9635\u7684\u51e0\u79cd\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h3>1\u3001\u4f7f\u7528\u6570\u7ec4\u521b\u5efa\u77e9\u9635<\/h3>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528<code>numpy.array()<\/code>\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\uff08\u77e9\u9635\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])<\/p>\n<p>print(&quot;Original Matrix:&quot;)<\/p>\n<p>print(matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2\u3001\u4f7f\u7528zeros()\u6216ones()\u51fd\u6570\u521b\u5efa\u77e9\u9635<\/h3>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528<code>numpy.zeros()<\/code>\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u5168\u96f6\u77e9\u9635\uff0c\u6216\u8005\u4f7f\u7528<code>numpy.ones()<\/code>\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u5168\u4e00\u77e9\u9635\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">zero_matrix = np.zeros((3, 3))<\/p>\n<p>one_matrix = np.ones((3, 3))<\/p>\n<p>print(&quot;Zero Matrix:&quot;)<\/p>\n<p>print(zero_matrix)<\/p>\n<p>print(&quot;One Matrix:&quot;)<\/p>\n<p>print(one_matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3\u3001\u4f7f\u7528eye()\u51fd\u6570\u521b\u5efa\u5355\u4f4d\u77e9\u9635<\/h3>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528<code>numpy.eye()<\/code>\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u5355\u4f4d\u77e9\u9635\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">identity_matrix = np.eye(3)<\/p>\n<p>print(&quot;Identity Matrix:&quot;)<\/p>\n<p>print(identity_matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e09\u3001\u77e9\u9635\u8f6c\u7f6e\u65b9\u6cd5<\/h2>\n<\/p>\n<p><h3>1\u3001\u4f7f\u7528numpy.transpose()\u51fd\u6570<\/h3>\n<\/p>\n<p><p>NumPy\u5e93\u63d0\u4f9b\u4e86<code>numpy.transpose()<\/code>\u51fd\u6570\u7528\u4e8e\u77e9\u9635\u8f6c\u7f6e\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528\u8be5\u51fd\u6570\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">transposed_matrix = np.transpose(matrix)<\/p>\n<p>print(&quot;Transposed Matrix using numpy.transpose():&quot;)<\/p>\n<p>print(transposed_matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2\u3001\u4f7f\u7528.T\u5c5e\u6027<\/h3>\n<\/p>\n<p><p>NumPy\u6570\u7ec4\u5bf9\u8c61\u5177\u6709\u4e00\u4e2a<code>.T<\/code>\u5c5e\u6027\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u83b7\u53d6\u77e9\u9635\u7684\u8f6c\u7f6e\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528<code>.T<\/code>\u5c5e\u6027\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">transposed_matrix = matrix.T<\/p>\n<p>print(&quot;Transposed Matrix using .T attribute:&quot;)<\/p>\n<p>print(transposed_matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3\u3001\u4f7f\u7528numpy.swapaxes()\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>numpy.swapaxes()<\/code>\u51fd\u6570\u53ef\u4ee5\u4ea4\u6362\u6570\u7ec4\u7684\u4e24\u4e2a\u8f74\uff0c\u4ece\u800c\u5b9e\u73b0\u77e9\u9635\u8f6c\u7f6e\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528\u8be5\u51fd\u6570\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">transposed_matrix = np.swapaxes(matrix, 0, 1)<\/p>\n<p>print(&quot;Transposed Matrix using numpy.swapaxes():&quot;)<\/p>\n<p>print(transposed_matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u56db\u3001\u77e9\u9635\u8f6c\u7f6e\u7684\u5e94\u7528\u573a\u666f<\/h2>\n<\/p>\n<p><p>\u77e9\u9635\u8f6c\u7f6e\u5728\u6570\u636e\u5206\u6790\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u548c\u79d1\u5b66\u8ba1\u7b97\u4e2d\u6709\u7740\u5e7f\u6cdb\u7684\u5e94\u7528\u3002\u4ee5\u4e0b\u662f\u51e0\u4e2a\u5e38\u89c1\u7684\u5e94\u7528\u573a\u666f\uff1a<\/p>\n<\/p>\n<p><h3>1\u3001\u6570\u636e\u9884\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u5728\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u4e2d\uff0c\u6570\u636e\u901a\u5e38\u4ee5\u77e9\u9635\u5f62\u5f0f\u5b58\u50a8\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u5bf9\u6570\u636e\u8fdb\u884c\u8f6c\u7f6e\u4ee5\u6ee1\u8db3\u7b97\u6cd5\u7684\u8f93\u5165\u8981\u6c42\u3002\u4f8b\u5982\uff0c\u5c06\u6570\u636e\u96c6\u7684\u884c\u548c\u5217\u4e92\u6362\uff0c\u4ee5\u4fbf\u8fdb\u884c\u6279\u5904\u7406\u6216\u5e76\u884c\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><h3>2\u3001\u56fe\u50cf\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u5728\u56fe\u50cf\u5904\u7406\u9886\u57df\uff0c\u56fe\u50cf\u53ef\u4ee5\u8868\u793a\u4e3a\u50cf\u7d20\u503c\u7684\u77e9\u9635\u3002\u5728\u67d0\u4e9b\u56fe\u50cf\u53d8\u6362\u64cd\u4f5c\uff08\u5982\u65cb\u8f6c\u3001\u53cd\u5c04\uff09\u4e2d\uff0c\u77e9\u9635\u8f6c\u7f6e\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h3>3\u3001\u7ebf\u6027\u4ee3\u6570\u8fd0\u7b97<\/h3>\n<\/p>\n<p><p>\u77e9\u9635\u8f6c\u7f6e\u5728\u7ebf\u6027\u4ee3\u6570\u4e2d\u662f\u4e00\u4e2a\u57fa\u672c\u64cd\u4f5c\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u77e9\u9635\u4e58\u6cd5\u3001\u6c42\u9006\u3001\u7279\u5f81\u503c\u5206\u89e3\u7b49\u8ba1\u7b97\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>4\u3001\u6df1\u5ea6\u5b66\u4e60<\/h3>\n<\/p>\n<p><p>\u5728\u6df1\u5ea6\u5b66\u4e60\u4e2d\uff0c\u795e\u7ecf\u7f51\u7edc\u7684\u8f93\u5165\u3001\u6743\u91cd\u548c\u8f93\u51fa\u901a\u5e38\u8868\u793a\u4e3a\u77e9\u9635\u3002\u5728\u8bad\u7ec3\u548c\u63a8\u7406\u8fc7\u7a0b\u4e2d\uff0c\u77e9\u9635\u8f6c\u7f6e\u64cd\u4f5c\u7528\u4e8e\u8c03\u6574\u6570\u636e\u7684\u5f62\u72b6\uff0c\u4ee5\u9002\u5e94\u4e0d\u540c\u5c42\u7684\u8f93\u5165\u8f93\u51fa\u8981\u6c42\u3002<\/p>\n<\/p>\n<p><h2>\u4e94\u3001\u77e9\u9635\u8f6c\u7f6e\u7684\u6027\u80fd\u8003\u8651<\/h2>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5927\u89c4\u6a21\u77e9\u9635\u65f6\uff0c\u77e9\u9635\u8f6c\u7f6e\u7684\u6027\u80fd\u662f\u4e00\u4e2a\u91cd\u8981\u8003\u8651\u56e0\u7d20\u3002NumPy\u5e93\u5728\u5e95\u5c42\u4f7f\u7528\u9ad8\u6548\u7684C\u8bed\u8a00\u5b9e\u73b0\uff0c\u80fd\u591f\u63d0\u4f9b\u5feb\u901f\u7684\u77e9\u9635\u8f6c\u7f6e\u64cd\u4f5c\u3002\u7136\u800c\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u9700\u8981\u8fdb\u4e00\u6b65\u4f18\u5316\u6027\u80fd\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f18\u5316\u5efa\u8bae\uff1a<\/p>\n<\/p>\n<p><h3>1\u3001\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u8f6c\u7f6e<\/h3>\n<\/p>\n<p><p>\u5728\u7f16\u5199\u4ee3\u7801\u65f6\uff0c\u5c3d\u91cf\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u77e9\u9635\u8f6c\u7f6e\u64cd\u4f5c\uff0c\u4ee5\u964d\u4f4e\u8ba1\u7b97\u5f00\u9500\u3002<\/p>\n<\/p>\n<p><h3>2\u3001\u4f7f\u7528\u5185\u5b58\u9ad8\u6548\u7684\u8f6c\u7f6e\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u5b58\u9ad8\u6548\u7684\u8f6c\u7f6e\u65b9\u6cd5\uff0c\u5982<code>numpy.swapaxes()<\/code>\uff0c\u4ee5\u51cf\u5c11\u5185\u5b58\u4f7f\u7528\u548c\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><h3>3\u3001\u5e76\u884c\u8ba1\u7b97<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u975e\u5e38\u5927\u7684\u77e9\u9635\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u5e76\u884c\u8ba1\u7b97\u6280\u672f\uff0c\u5982\u591a\u7ebf\u7a0b\u3001\u591a\u8fdb\u7a0b\u6216GPU\u52a0\u901f\uff0c\u4ee5\u63d0\u9ad8\u77e9\u9635\u8f6c\u7f6e\u7684\u6027\u80fd\u3002<\/p>\n<\/p>\n<p><h2>\u516d\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u5728Python\u4e2d\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u5176\u4e2d\u4f7f\u7528NumPy\u5e93\u662f\u6700\u5e38\u89c1\u548c\u9ad8\u6548\u7684\u65b9\u6cd5\u3002\u901a\u8fc7<code>numpy.transpose()<\/code>\u51fd\u6570\u3001<code>.T<\/code>\u5c5e\u6027\u548c<code>numpy.swapaxes()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u5bf9\u77e9\u9635\u8fdb\u884c\u8f6c\u7f6e\u64cd\u4f5c\u3002\u77e9\u9635\u8f6c\u7f6e\u5728\u6570\u636e\u5206\u6790\u3001\u673a\u5668\u5b66\u4e60\u3001\u56fe\u50cf\u5904\u7406\u548c\u7ebf\u6027\u4ee3\u6570\u4e2d\u6709\u7740\u5e7f\u6cdb\u7684\u5e94\u7528\u3002\u5728\u5904\u7406\u5927\u89c4\u6a21\u77e9\u9635\u65f6\uff0c\u9700\u8981\u8003\u8651\u6027\u80fd\u4f18\u5316\uff0c\u5c3d\u91cf\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u8f6c\u7f6e\u64cd\u4f5c\uff0c\u5e76\u4f7f\u7528\u5185\u5b58\u9ad8\u6548\u7684\u8f6c\u7f6e\u65b9\u6cd5\u548c\u5e76\u884c\u8ba1\u7b97\u6280\u672f\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u638c\u63e1Python\u4e2d\u7684\u77e9\u9635\u8f6c\u7f6e\u65b9\u6cd5\u53ca\u5176\u5e94\u7528\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u77e9\u9635\u8f6c\u7f6e\u7684\u57fa\u672c\u65b9\u6cd5\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\u77e9\u9635\u7684\u8f6c\u7f6e\u3002\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u5d4c\u5957\u5faa\u73af\u904d\u5386\u77e9\u9635\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u77e9\u9635\uff0c\u5e76\u5c06\u884c\u548c\u5217\u7684\u7d22\u5f15\u4ea4\u6362\u3002\u6b64\u5916\uff0cNumPy\u5e93\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u901a\u8fc7<code>.T<\/code>\u5c5e\u6027\u76f4\u63a5\u5b9e\u73b0\u8f6c\u7f6e\u3002\u4f7f\u7528NumPy\u4e0d\u4ec5\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\uff0c\u8fd8\u80fd\u4f18\u5316\u6027\u80fd\uff0c\u7279\u522b\u662f\u5728\u5904\u7406\u5927\u578b\u77e9\u9635\u65f6\u3002<\/p>\n<p><strong>\u4f7f\u7528NumPy\u5e93\u8f6c\u7f6e\u77e9\u9635\u7684\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u8981\u4f7f\u7528NumPy\u5e93\u8fdb\u884c\u77e9\u9635\u8f6c\u7f6e\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5NumPy\u5e93\uff08\u5982\u679c\u5c1a\u672a\u5b89\u88c5\uff09\u3002\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4<code>pip install numpy<\/code>\u8fdb\u884c\u5b89\u88c5\u3002\u63a5\u4e0b\u6765\uff0c\u901a\u8fc7\u5bfc\u5165NumPy\u5e76\u4f7f\u7528<code>numpy.array()<\/code>\u51fd\u6570\u521b\u5efa\u4e00\u4e2a\u77e9\u9635\u3002\u6700\u540e\uff0c\u8c03\u7528<code>.T<\/code>\u5c5e\u6027\u5373\u53ef\u83b7\u5f97\u8f6c\u7f6e\u77e9\u9635\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">import numpy as np\n\nmatrix = np.array([[1, 2, 3], [4, 5, 6]])\ntransposed_matrix = matrix.T\nprint(transposed_matrix)\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u8f93\u51fa\u8f6c\u7f6e\u540e\u7684\u77e9\u9635\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5904\u7406\u5927\u89c4\u6a21\u77e9\u9635\u8f6c\u7f6e\u65f6\uff0c\u6027\u80fd\u5982\u4f55\u4f18\u5316\uff1f<\/strong><br \/>\u5f53\u5904\u7406\u5927\u89c4\u6a21\u77e9\u9635\u65f6\uff0c\u4f7f\u7528NumPy\u5e93\u8fdb\u884c\u8f6c\u7f6e\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u9009\u62e9\uff0c\u56e0\u4e3aNumPy\u4e13\u4e3a\u9ad8\u6548\u6570\u503c\u8ba1\u7b97\u8bbe\u8ba1\uff0c\u5e95\u5c42\u4f7f\u7528\u4e86C\u8bed\u8a00\u5b9e\u73b0\uff0c\u80fd\u591f\u663e\u8457\u63d0\u9ad8\u6027\u80fd\u3002\u6b64\u5916\uff0c\u8003\u8651\u4f7f\u7528<code>numpy.dot()<\/code>\u6216<code>numpy.matmul()<\/code>\u7b49\u51fd\u6570\u6765\u8fdb\u884c\u77e9\u9635\u8fd0\u7b97\uff0c\u8fd9\u4e9b\u51fd\u6570\u5728\u6267\u884c\u8f6c\u7f6e\u64cd\u4f5c\u65f6\u4e5f\u80fd\u63d0\u4f9b\u66f4\u597d\u7684\u901f\u5ea6\u548c\u6027\u80fd\u3002\u4f7f\u7528\u5207\u7247\u64cd\u4f5c\u4e5f\u80fd\u51cf\u5c11\u5185\u5b58\u6d88\u8017\uff0c\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\u6765\u8fdb\u884c\u77e9\u9635\u7684\u8f6c\u7f6e\uff0c\u5982\u4f7f\u7528\u5d4c\u5957\u5faa\u73af\u3001\u5217\u8868\u63a8\u5bfc\u3001\u4ee5\u53caNumPy\u5e93\u7b49\u3002\u4f7f\u7528\u5d4c\u5957\u5faa\u73af [&hellip;]","protected":false},"author":3,"featured_media":1096619,"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\/1096609"}],"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=1096609"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096609\/revisions"}],"predecessor-version":[{"id":1096621,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1096609\/revisions\/1096621"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1096619"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1096609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1096609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1096609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}