{"id":991619,"date":"2024-12-27T08:30:35","date_gmt":"2024-12-27T00:30:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/991619.html"},"modified":"2024-12-27T08:30:38","modified_gmt":"2024-12-27T00:30:38","slug":"python%e5%a6%82%e4%bd%95%e5%ae%9a%e4%b9%89%e5%a4%9a%e7%bb%b4%e7%9f%a9%e9%98%b5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/991619.html","title":{"rendered":"python\u5982\u4f55\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25065826\/2973c78d-9edb-430b-88b5-962ca4a12d35.webp\" alt=\"python\u5982\u4f55\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635\" \/><\/p>\n<p><p> \u5728Python\u4e2d\uff0c\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c<strong>\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u5d4c\u5957\u5217\u8868\u3001NumPy\u5e93\u548cPandas\u5e93<\/strong>\u3002\u5176\u4e2d\uff0cNumPy\u5e93\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u77e9\u9635\u64cd\u4f5c\u529f\u80fd\uff0c\u5e76\u4e14\u5728\u6027\u80fd\u4e0a\u4e5f\u66f4\u4f18\u8d8a\u3002\u4f7f\u7528NumPy\u5e93\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u591a\u7ef4\u6570\u7ec4\u6765\u5b9e\u73b0\uff0c\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u4ec5\u7b80\u6d01\uff0c\u800c\u4e14\u5728\u6267\u884c\u6570\u5b66\u8fd0\u7b97\u65f6\u975e\u5e38\u9ad8\u6548\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u51e0\u79cd\u65b9\u6cd5\u6765\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u5d4c\u5957\u5217\u8868\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635<\/p>\n<\/p>\n<p><p>\u5d4c\u5957\u5217\u8868\u662fPython\u5185\u7f6e\u7684\u6570\u636e\u7ed3\u6784\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635\u3002\u867d\u7136\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u76f4\u89c2\uff0c\u4f46\u5728\u5904\u7406\u5927\u578b\u77e9\u9635\u65f6\u6548\u7387\u8f83\u4f4e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5b9a\u4e49\u4e00\u4e2a\u4e8c\u7ef4\u77e9\u9635<\/p>\n<p>matrix_2d = [<\/p>\n<p>    [1, 2, 3],<\/p>\n<p>    [4, 5, 6],<\/p>\n<p>    [7, 8, 9]<\/p>\n<p>]<\/p>\n<h2><strong>\u5b9a\u4e49\u4e00\u4e2a\u4e09\u7ef4\u77e9\u9635<\/strong><\/h2>\n<p>matrix_3d = [<\/p>\n<p>    [<\/p>\n<p>        [1, 2, 3],<\/p>\n<p>        [4, 5, 6]<\/p>\n<p>    ],<\/p>\n<p>    [<\/p>\n<p>        [7, 8, 9],<\/p>\n<p>        [10, 11, 12]<\/p>\n<p>    ]<\/p>\n<p>]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5d4c\u5957\u5217\u8868\u7684\u4f18\u70b9\u662f\u7b80\u5355\u6613\u7528\uff0c\u6ca1\u6709\u4f9d\u8d56\u5916\u90e8\u5e93\uff0c\u9002\u5408\u5c0f\u89c4\u6a21\u6570\u636e\u7684\u5904\u7406\u3002\u7136\u800c\u5728\u8fdb\u884c\u77e9\u9635\u8fd0\u7b97\u65f6\uff0c\u5904\u7406\u8d77\u6765\u76f8\u5bf9\u7e41\u7410\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528NumPy\u5e93\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635<\/p>\n<\/p>\n<p><p>NumPy\u662fPython\u79d1\u5b66\u8ba1\u7b97\u7684\u57fa\u7840\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u9ad8\u6027\u80fd\u7684\u591a\u7ef4\u6570\u7ec4\u5bf9\u8c61ndarray\uff0c\u5e76\u4e14\u6709\u4e30\u5bcc\u7684\u51fd\u6570\u7528\u4e8e\u6570\u7ec4\u7684\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5NumPy\u5e93<\/li>\n<\/ol>\n<p><p>\u5728\u5f00\u59cb\u4f7f\u7528NumPy\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u5df2\u5b89\u88c5\u8be5\u5e93\u3002\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<ol start=\"2\">\n<li>\u521b\u5efa\u591a\u7ef4\u77e9\u9635<\/li>\n<\/ol>\n<p><p>NumPy\u7684\u6838\u5fc3\u5bf9\u8c61\u662fndarray\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u521b\u5efa\u591a\u7ef4\u77e9\u9635\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u4e8c\u7ef4\u77e9\u9635<\/strong><\/h2>\n<p>matrix_2d = np.array([<\/p>\n<p>    [1, 2, 3],<\/p>\n<p>    [4, 5, 6],<\/p>\n<p>    [7, 8, 9]<\/p>\n<p>])<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u4e09\u7ef4\u77e9\u9635<\/strong><\/h2>\n<p>matrix_3d = np.array([<\/p>\n<p>    [<\/p>\n<p>        [1, 2, 3],<\/p>\n<p>        [4, 5, 6]<\/p>\n<p>    ],<\/p>\n<p>    [<\/p>\n<p>        [7, 8, 9],<\/p>\n<p>        [10, 11, 12]<\/p>\n<p>    ]<\/p>\n<p>])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>NumPy\u63d0\u4f9b\u4e86\u8bb8\u591a\u51fd\u6570\u6765\u521b\u5efa\u7279\u6b8a\u77e9\u9635\uff0c\u6bd4\u5982\u5168\u96f6\u77e9\u9635\u3001\u5168\u4e00\u77e9\u9635\u3001\u5355\u4f4d\u77e9\u9635\u7b49\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u4e00\u4e2a3x3\u7684\u96f6\u77e9\u9635<\/p>\n<p>zero_matrix = np.zeros((3, 3))<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a3x3\u7684\u5355\u4f4d\u77e9\u9635<\/strong><\/h2>\n<p>identity_matrix = np.eye(3)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a3x3\u7684\u5168\u4e00\u77e9\u9635<\/strong><\/h2>\n<p>ones_matrix = np.ones((3, 3))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u77e9\u9635\u8fd0\u7b97<\/li>\n<\/ol>\n<p><p>NumPy\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u7ebf\u6027\u4ee3\u6570\u8fd0\u7b97\u529f\u80fd\uff0c\u53ef\u4ee5\u8f7b\u677e\u8fdb\u884c\u77e9\u9635\u52a0\u6cd5\u3001\u4e58\u6cd5\u3001\u8f6c\u7f6e\u7b49\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u77e9\u9635\u52a0\u6cd5<\/p>\n<p>matrix_sum = matrix_2d + ones_matrix<\/p>\n<h2><strong>\u77e9\u9635\u4e58\u6cd5<\/strong><\/h2>\n<p>matrix_product = np.dot(matrix_2d, identity_matrix)<\/p>\n<h2><strong>\u77e9\u9635\u8f6c\u7f6e<\/strong><\/h2>\n<p>matrix_transpose = np.transpose(matrix_2d)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528Pandas\u5e93\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635<\/p>\n<\/p>\n<p><p>Pandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5206\u6790\u548c\u5904\u7406\u5e93\uff0c\u867d\u7136\u4e3b\u8981\u7528\u4e8e\u6570\u636e\u6846\uff08DataFrame\uff09\u7684\u64cd\u4f5c\uff0c\u4f46\u4e5f\u53ef\u4ee5\u7528\u4e8e\u591a\u7ef4\u77e9\u9635\u7684\u5904\u7406\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Pandas\u5e93<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Pandas\u521b\u5efa\u4e8c\u7ef4\u77e9\u9635<\/li>\n<\/ol>\n<p><p>Pandas\u7684DataFrame\u53ef\u4ee5\u770b\u4f5c\u662f\u4e8c\u7ef4\u77e9\u9635\u7684\u4e00\u4e2a\u62bd\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2aDataFrame<\/strong><\/h2>\n<p>df = pd.DataFrame({<\/p>\n<p>    &#39;A&#39;: [1, 4, 7],<\/p>\n<p>    &#39;B&#39;: [2, 5, 8],<\/p>\n<p>    &#39;C&#39;: [3, 6, 9]<\/p>\n<p>})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4<\/li>\n<\/ol>\n<p><p>Pandas\u7684DataFrame\u53ef\u4ee5\u65b9\u4fbf\u5730\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4\uff0c\u4ece\u800c\u8fdb\u884c\u77e9\u9635\u8fd0\u7b97\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5c06DataFrame\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4<\/p>\n<p>numpy_matrix = df.to_numpy()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u591a\u7ef4\u77e9\u9635\u7684\u5e94\u7528<\/p>\n<\/p>\n<p><p>\u591a\u7ef4\u77e9\u9635\u5728\u6570\u636e\u79d1\u5b66\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u3001\u56fe\u50cf\u5904\u7406\u7b49\u9886\u57df\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u3002\u5229\u7528Python\u7684NumPy\u5e93\uff0c\u53ef\u4ee5\u9ad8\u6548\u5730\u8fdb\u884c\u77e9\u9635\u7684\u521b\u5efa\u548c\u64cd\u4f5c\uff0c\u4ece\u800c\u5b9e\u73b0\u590d\u6742\u7684\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u3002\u4ee5\u4e0b\u662f\u51e0\u4e2a\u5e38\u89c1\u7684\u5e94\u7528\u573a\u666f\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u56fe\u50cf\u5904\u7406<\/li>\n<\/ol>\n<p><p>\u5728\u56fe\u50cf\u5904\u7406\u4e2d\uff0c\u56fe\u50cf\u901a\u5e38\u88ab\u8868\u793a\u4e3a\u4e8c\u7ef4\u6216\u4e09\u7ef4\u77e9\u9635\u3002\u4e8c\u7ef4\u77e9\u9635\u7528\u4e8e\u7070\u5ea6\u56fe\u50cf\uff0c\u800c\u4e09\u7ef4\u77e9\u9635\u7528\u4e8e\u5f69\u8272\u56fe\u50cf\uff08RGB\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<h2><strong>\u6253\u5f00\u56fe\u50cf\u5e76\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4<\/strong><\/h2>\n<p>img = Image.open(&#39;example.jpg&#39;)<\/p>\n<p>img_array = np.array(img)<\/p>\n<h2><strong>\u5bf9\u56fe\u50cf\u8fdb\u884c\u7b80\u5355\u5904\u7406\uff0c\u6bd4\u5982\u8f6c\u4e3a\u7070\u5ea6<\/strong><\/h2>\n<p>gray_img_array = np.mean(img_array, axis=2)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u673a\u5668\u5b66\u4e60<\/li>\n<\/ol>\n<p><p>\u5728\u673a\u5668\u5b66\u4e60\u4e2d\uff0c\u8bad\u7ec3\u6570\u636e\u901a\u5e38\u4ee5\u77e9\u9635\u7684\u5f62\u5f0f\u5b58\u50a8\uff0c\u5176\u4e2d\u6bcf\u4e00\u884c\u4ee3\u8868\u4e00\u4e2a\u6837\u672c\uff0c\u6bcf\u4e00\u5217\u4ee3\u8868\u4e00\u4e2a\u7279\u5f81\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u4e00\u4e2a\u6837\u672c\u77e9\u9635<\/p>\n<p>samples = np.array([<\/p>\n<p>    [1.5, 2.3, 3.1],<\/p>\n<p>    [4.5, 5.1, 6.2],<\/p>\n<p>    [7.8, 8.0, 9.9]<\/p>\n<p>])<\/p>\n<h2><strong>\u8fdb\u884c\u6807\u51c6\u5316\u5904\u7406<\/strong><\/h2>\n<p>mean = np.mean(samples, axis=0)<\/p>\n<p>std_dev = np.std(samples, axis=0)<\/p>\n<p>normalized_samples = (samples - mean) \/ std_dev<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u79d1\u5b66\u8ba1\u7b97<\/li>\n<\/ol>\n<p><p>\u5728\u79d1\u5b66\u8ba1\u7b97\u4e2d\uff0c\u591a\u7ef4\u77e9\u9635\u7528\u4e8e\u6c42\u89e3\u7ebf\u6027\u65b9\u7a0b\u7ec4\u3001\u6267\u884c\u5085\u91cc\u53f6\u53d8\u6362\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6c42\u89e3\u7ebf\u6027\u65b9\u7a0b\u7ec4<\/p>\n<p>coefficients = np.array([<\/p>\n<p>    [3, 2, -1],<\/p>\n<p>    [2, -2, 4],<\/p>\n<p>    [-1, 0.5, -1]<\/p>\n<p>])<\/p>\n<p>constants = np.array([1, -2, 0])<\/p>\n<p>solution = np.linalg.solve(coefficients, constants)<\/p>\n<h2><strong>\u8fdb\u884c\u5085\u91cc\u53f6\u53d8\u6362<\/strong><\/h2>\n<p>signal = np.sin(np.linspace(0, 2 * np.pi, 100))<\/p>\n<p>fourier_transform = np.fft.fft(signal)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u4ecb\u7ecd\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c<strong>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u5f0f\u6765\u5b9a\u4e49\u548c\u64cd\u4f5c\u591a\u7ef4\u77e9\u9635<\/strong>\u3002\u5176\u4e2d\uff0cNumPy\u5e93\u56e0\u5176\u5f3a\u5927\u7684\u529f\u80fd\u548c\u9ad8\u6548\u7684\u6027\u80fd\uff0c\u6210\u4e3a\u5904\u7406\u591a\u7ef4\u77e9\u9635\u7684\u9996\u9009\u5de5\u5177\u3002\u65e0\u8bba\u662f\u5728\u56fe\u50cf\u5904\u7406\u3001\u673a\u5668\u5b66\u4e60\u8fd8\u662f\u79d1\u5b66\u8ba1\u7b97\u4e2d\uff0c\u7075\u6d3b\u8fd0\u7528\u8fd9\u4e9b\u5de5\u5177\u90fd\u80fd\u6781\u5927\u5730\u63d0\u9ad8\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u7684\u6548\u7387\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u521b\u5efa\u4e00\u4e2a\u4e8c\u7ef4\u77e9\u9635\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u5d4c\u5957\u7684\u65b9\u5f0f\u6765\u521b\u5efa\u4e00\u4e2a\u4e8c\u7ef4\u77e9\u9635\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u5b9a\u4e49\u4e00\u4e2a3&#215;3\u7684\u77e9\u9635\uff1a  <\/p>\n<pre><code class=\"language-python\">matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n<\/code><\/pre>\n<p>\u6b64\u5916\uff0cNumPy\u5e93\u63d0\u4f9b\u4e86\u66f4\u52a0\u9ad8\u6548\u7684\u65b9\u6cd5\u6765\u521b\u5efa\u77e9\u9635\uff0c\u53ef\u4ee5\u4f7f\u7528<code>numpy.array()<\/code>\u51fd\u6570\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">import numpy as np\nmatrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n<\/code><\/pre>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u5b9a\u4e49\u4e00\u4e2a\u4e09\u7ef4\u77e9\u9635\uff1f<\/strong><br \/>\u5b9a\u4e49\u4e09\u7ef4\u77e9\u9635\u7684\u65b9\u5f0f\u4e0e\u4e8c\u7ef4\u77e9\u9635\u7c7b\u4f3c\uff0c\u53ea\u9700\u5728\u5d4c\u5957\u5217\u8868\u4e2d\u589e\u52a0\u4e00\u5c42\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u521b\u5efa\u4e00\u4e2a2x2x2\u7684\u4e09\u7ef4\u77e9\u9635\uff1a  <\/p>\n<pre><code class=\"language-python\">matrix = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n<\/code><\/pre>\n<p>\u4f7f\u7528NumPy\u5e93\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7<code>numpy.array()<\/code>\u6765\u521b\u5efa\u4e09\u7ef4\u77e9\u9635\uff0c\u793a\u4f8b\u5982\u4e0b\uff1a  <\/p>\n<pre><code class=\"language-python\">import numpy as np\nmatrix = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])\n<\/code><\/pre>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u8bbf\u95ee\u591a\u7ef4\u77e9\u9635\u7684\u5143\u7d20\uff1f<\/strong><br \/>\u8bbf\u95ee\u591a\u7ef4\u77e9\u9635\u7684\u5143\u7d20\u53ef\u4ee5\u901a\u8fc7\u7d22\u5f15\u5b9e\u73b0\u3002\u4ee5\u4e8c\u7ef4\u77e9\u9635\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528<code>matrix[row][column]<\/code>\u7684\u65b9\u5f0f\u8bbf\u95ee\u7279\u5b9a\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u8981\u8bbf\u95ee\u4e0a\u9762\u5b9a\u4e49\u7684\u77e9\u9635\u4e2d\u7684\u6570\u5b575\uff0c\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a  <\/p>\n<pre><code class=\"language-python\">element = matrix[1][1]  # \u7ed3\u679c\u4e3a5\n<\/code><\/pre>\n<p>\u5bf9\u4e8e\u4e09\u7ef4\u77e9\u9635\uff0c\u8bbf\u95ee\u5143\u7d20\u7684\u65b9\u6cd5\u662f<code>matrix[depth][row][column]<\/code>\uff0c\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">element = matrix[1][0][1]  # \u7ed3\u679c\u4e3a6\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u8bbf\u95ee\u548c\u64cd\u4f5c\u591a\u7ef4\u77e9\u9635\u4e2d\u7684\u6570\u636e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u5b9a\u4e49\u591a\u7ef4\u77e9\u9635\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u5d4c\u5957\u5217\u8868\u3001NumPy\u5e93\u548cPandas\u5e93\u3002\u5176\u4e2d\uff0cN [&hellip;]","protected":false},"author":3,"featured_media":991627,"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\/991619"}],"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=991619"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/991619\/revisions"}],"predecessor-version":[{"id":991629,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/991619\/revisions\/991629"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/991627"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=991619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=991619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=991619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}