{"id":1154984,"date":"2025-01-13T17:57:52","date_gmt":"2025-01-13T09:57:52","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1154984.html"},"modified":"2025-01-13T17:57:54","modified_gmt":"2025-01-13T09:57:54","slug":"python%e9%87%8c%e9%9d%a2cos%e5%a6%82%e4%bd%95%e5%ae%9a%e4%b9%89","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1154984.html","title":{"rendered":"python\u91cc\u9762cos\u5982\u4f55\u5b9a\u4e49"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25184502\/173ae051-57fc-458c-94b3-82b8cbfca7bf.webp\" alt=\"python\u91cc\u9762cos\u5982\u4f55\u5b9a\u4e49\" \/><\/p>\n<p><p> \u5728Python\u4e2d\uff0c<strong>cos\u51fd\u6570\u662f\u901a\u8fc7math\u5e93\u4e2d\u7684cos\u65b9\u6cd5\u6765\u5b9a\u4e49\u7684<\/strong>\u3001<strong>math\u5e93\u63d0\u4f9b\u4e86\u8bb8\u591a\u6570\u5b66\u51fd\u6570\u548c\u5e38\u91cf<\/strong>\u3001<strong>\u4f7f\u7528cos\u51fd\u6570\u53ef\u4ee5\u8ba1\u7b97\u4e00\u4e2a\u89d2\u5ea6\u7684\u4f59\u5f26\u503c<\/strong>\u3002\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528cos\u51fd\u6570\uff0c\u6211\u4eec\u9700\u8981\u4e86\u89e3\u5176\u5b9a\u4e49\u3001\u4f7f\u7528\u65b9\u6cd5\u4ee5\u53ca\u4e00\u4e9b\u76f8\u5173\u7684\u6982\u5ff5\u3002<\/p>\n<\/p>\n<p><p>Python\u4e2d\u7684math\u5e93\u63d0\u4f9b\u4e86\u5404\u79cd\u6570\u5b66\u51fd\u6570\uff0c\u5176\u4e2d\u4e4b\u4e00\u5c31\u662fcos\u51fd\u6570\u3002cos\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u4e00\u4e2a\u89d2\u5ea6\u7684\u4f59\u5f26\u503c\uff0c\u8f93\u5165\u7684\u89d2\u5ea6\u5fc5\u987b\u662f\u5f27\u5ea6\u5236\u3002\u5982\u679c\u89d2\u5ea6\u662f\u89d2\u5ea6\u5236\uff0c\u9700\u8981\u5c06\u5176\u8f6c\u6362\u4e3a\u5f27\u5ea6\u5236\u540e\u518d\u8fdb\u884c\u8ba1\u7b97\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u63cf\u8ff0\uff1a<\/p>\n<\/p>\n<p><h3>\u4e00\u3001math\u5e93\u7684\u4ecb\u7ecd<\/h3>\n<\/p>\n<p><p>Python\u7684math\u5e93\u63d0\u4f9b\u4e86\u8bb8\u591a\u6807\u51c6\u7684\u6570\u5b66\u51fd\u6570\u548c\u5e38\u91cf\uff0c\u5305\u62ec\u4e09\u89d2\u51fd\u6570\u3001\u5bf9\u6570\u51fd\u6570\u3001\u6307\u6570\u51fd\u6570\u7b49\u3002math\u5e93\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u4f7f\u7528\u65f6\u4e0d\u9700\u8981\u5b89\u88c5\u989d\u5916\u7684\u5305\uff0c\u53ea\u9700\u5bfc\u5165\u5373\u53ef\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u5bfc\u5165math\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5176\u4e2d\u7684\u5404\u79cd\u6570\u5b66\u51fd\u6570\u548c\u5e38\u91cf\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001cos\u51fd\u6570\u7684\u5b9a\u4e49\u4e0e\u4f7f\u7528<\/h3>\n<\/p>\n<p><p><strong>cos\u51fd\u6570<\/strong>\u662fmath\u5e93\u4e2d\u7528\u4e8e\u8ba1\u7b97\u4f59\u5f26\u503c\u7684\u51fd\u6570\u3002\u5176\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p>result = math.cos(x)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d\uff0c<code>x<\/code>\u662f\u5f27\u5ea6\u5236\u7684\u89d2\u5ea6\u3002cos\u51fd\u6570\u8fd4\u56de\u4f59\u5f26\u503c\uff0c\u8be5\u503c\u5728-1\u52301\u4e4b\u95f4\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\u4ee3\u7801<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u8ba1\u7b970\u5f27\u5ea6\u7684\u4f59\u5f26\u503c<\/strong><\/h2>\n<p>result = math.cos(0)<\/p>\n<p>print(result)  # \u8f93\u51fa\uff1a1.0<\/p>\n<h2><strong>\u8ba1\u7b97\u03c0\/2\u5f27\u5ea6\u7684\u4f59\u5f26\u503c<\/strong><\/h2>\n<p>result = math.cos(math.pi \/ 2)<\/p>\n<p>print(result)  # \u8f93\u51fa\uff1a6.123233995736766e-17\uff08\u63a5\u8fd1\u4e8e0\uff09<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u89d2\u5ea6\u5236\u4e0e\u5f27\u5ea6\u5236\u7684\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u4f7f\u7528\u89d2\u5ea6\u5236\uff08\u5ea6\uff09\u6765\u8868\u793a\u89d2\u5ea6\uff0c\u800cPython\u7684cos\u51fd\u6570\u9700\u8981\u8f93\u5165\u5f27\u5ea6\u5236\u7684\u89d2\u5ea6\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u8fdb\u884c\u89d2\u5ea6\u5236\u4e0e\u5f27\u5ea6\u5236\u7684\u8f6c\u6362\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u89d2\u5ea6\u5236\u8f6c\u6362\u4e3a\u5f27\u5ea6\u5236<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u89d2\u5ea6\u8f6c\u5f27\u5ea6<\/strong><\/h2>\n<p>degrees = 90<\/p>\n<p>radians = math.radians(degrees)<\/p>\n<p>print(radians)  # \u8f93\u51fa\uff1a1.5707963267948966<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5f27\u5ea6\u5236\u8f6c\u6362\u4e3a\u89d2\u5ea6\u5236<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u5f27\u5ea6\u8f6c\u89d2\u5ea6<\/strong><\/h2>\n<p>radians = math.pi \/ 2<\/p>\n<p>degrees = math.degrees(radians)<\/p>\n<p>print(degrees)  # \u8f93\u51fa\uff1a90.0<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001cos\u51fd\u6570\u7684\u5e94\u7528<\/h3>\n<\/p>\n<p><p>cos\u51fd\u6570\u5728\u8bb8\u591a\u9886\u57df\u90fd\u6709\u5e94\u7528\uff0c\u5305\u62ec\u7269\u7406\u5b66\u3001\u5de5\u7a0b\u5b66\u3001\u8ba1\u7b97\u673a\u56fe\u5f62\u5b66\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5178\u578b\u7684\u5e94\u7528\u573a\u666f\uff1a<\/p>\n<\/p>\n<p><h4>1. <strong>\u7269\u7406\u5b66\u4e2d\u7684\u5e94\u7528<\/strong><\/h4>\n<\/p>\n<p><p>\u5728\u7269\u7406\u5b66\u4e2d\uff0c\u4f59\u5f26\u51fd\u6570\u5e38\u7528\u4e8e\u63cf\u8ff0\u6ce2\u52a8\u548c\u632f\u52a8\u3002\u4f8b\u5982\uff0c\u5728\u7b80\u8c10\u8fd0\u52a8\u4e2d\uff0c\u4f4d\u79fb\u53ef\u4ee5\u8868\u793a\u4e3a\u4f59\u5f26\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u7b80\u8c10\u8fd0\u52a8\u7684\u4f4d\u79fb<\/strong><\/h2>\n<p>A = 1.0  # \u632f\u5e45<\/p>\n<p>omega = 2.0 * math.pi  # \u89d2\u9891\u7387<\/p>\n<p>t = 0.5  # \u65f6\u95f4<\/p>\n<p>displacement = A * math.cos(omega * t)<\/p>\n<p>print(displacement)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. <strong>\u5de5\u7a0b\u5b66\u4e2d\u7684\u5e94\u7528<\/strong><\/h4>\n<\/p>\n<p><p>\u5728\u5de5\u7a0b\u5b66\u4e2d\uff0c\u4f59\u5f26\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u5206\u6790\u5468\u671f\u6027\u4fe1\u53f7\uff0c\u4f8b\u5982\u4ea4\u6d41\u7535\u7684\u7535\u538b\u548c\u7535\u6d41\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u4ea4\u6d41\u7535\u7684\u7535\u538b<\/strong><\/h2>\n<p>V_max = 220.0  # \u6700\u5927\u7535\u538b<\/p>\n<p>omega = 2.0 * math.pi * 50  # \u89d2\u9891\u7387\uff0850Hz\uff09<\/p>\n<p>t = 0.01  # \u65f6\u95f4<\/p>\n<p>voltage = V_max * math.cos(omega * t)<\/p>\n<p>print(voltage)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. <strong>\u8ba1\u7b97\u673a\u56fe\u5f62\u5b66\u4e2d\u7684\u5e94\u7528<\/strong><\/h4>\n<\/p>\n<p><p>\u5728\u8ba1\u7b97\u673a\u56fe\u5f62\u5b66\u4e2d\uff0c\u4f59\u5f26\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u751f\u6210\u5e73\u6ed1\u7684\u52a8\u753b\u6548\u679c\u548c\u8ba1\u7b97\u65cb\u8f6c\u53d8\u6362\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u8ba1\u7b97\u65cb\u8f6c\u53d8\u6362<\/strong><\/h2>\n<p>angle = math.pi \/ 4  # 45\u5ea6<\/p>\n<p>x = 1.0<\/p>\n<p>y = 0.0<\/p>\n<p>x_rotated = x * math.cos(angle) - y * math.sin(angle)<\/p>\n<p>y_rotated = x * math.sin(angle) + y * math.cos(angle)<\/p>\n<p>print(x_rotated, y_rotated)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5176\u4ed6\u76f8\u5173\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u9664\u4e86cos\u51fd\u6570\u5916\uff0cmath\u5e93\u8fd8\u63d0\u4f9b\u4e86\u5176\u4ed6\u4e09\u89d2\u51fd\u6570\uff0c\u5305\u62ecsin\u3001tan\u3001acos\u3001asin\u548catan\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1. <strong>sin\u51fd\u6570<\/strong><\/h4>\n<\/p>\n<p><p>sin\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u6b63\u5f26\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p>result = math.sin(math.pi \/ 2)<\/p>\n<p>print(result)  # \u8f93\u51fa\uff1a1.0<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. <strong>tan\u51fd\u6570<\/strong><\/h4>\n<\/p>\n<p><p>tan\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u6b63\u5207\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p>result = math.tan(math.pi \/ 4)<\/p>\n<p>print(result)  # \u8f93\u51fa\uff1a1.0<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. <strong>\u53cd\u4e09\u89d2\u51fd\u6570<\/strong><\/h4>\n<\/p>\n<p><p>\u53cd\u4e09\u89d2\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u5f27\u5ea6\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p>result = math.acos(1.0)<\/p>\n<p>print(result)  # \u8f93\u51fa\uff1a0.0<\/p>\n<p>result = math.asin(1.0)<\/p>\n<p>print(result)  # \u8f93\u51fa\uff1a1.5707963267948966<\/p>\n<p>result = math.atan(1.0)<\/p>\n<p>print(result)  # \u8f93\u51fa\uff1a0.7853981633974483<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528numpy\u5e93\u8fdb\u884c\u9ad8\u7ea7\u8ba1\u7b97<\/h3>\n<\/p>\n<p><p>\u9664\u4e86math\u5e93\u5916\uff0cnumpy\u5e93\u4e5f\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6570\u5b66\u51fd\u6570\uff0c\u5305\u62eccos\u51fd\u6570\u3002numpy\u5e93\u9002\u7528\u4e8e\u8fdb\u884c\u66f4\u590d\u6742\u7684\u6570\u5b66\u8ba1\u7b97\u548c\u77e9\u9635\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u4f7f\u7528numpy\u8ba1\u7b97\u4f59\u5f26\u503c<\/strong><\/h2>\n<p>angles = np.array([0, np.pi\/4, np.pi\/2, np.pi])<\/p>\n<p>cos_values = np.cos(angles)<\/p>\n<p>print(cos_values)  # \u8f93\u51fa\uff1a[ 1.000000e+00  7.071068e-01  6.123234e-17 -1.000000e+00]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u6027\u80fd\u6bd4\u8f83<\/h3>\n<\/p>\n<p><p>\u5728\u9009\u62e9\u4f7f\u7528math\u5e93\u8fd8\u662fnumpy\u5e93\u65f6\uff0c\u6027\u80fd\u662f\u4e00\u4e2a\u9700\u8981\u8003\u8651\u7684\u56e0\u7d20\u3002\u5bf9\u4e8e\u5355\u4e00\u503c\u7684\u8ba1\u7b97\uff0cmath\u5e93\u901a\u5e38\u8f83\u5feb\uff1b\u800c\u5bf9\u4e8e\u5927\u89c4\u6a21\u6570\u7ec4\u7684\u8ba1\u7b97\uff0cnumpy\u5e93\u66f4\u5177\u4f18\u52bf\u3002<\/p>\n<\/p>\n<p><h4>1. <strong>math\u5e93\u7684\u6027\u80fd<\/strong><\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p>import time<\/p>\n<p>start_time = time.time()<\/p>\n<p>for i in range(1000000):<\/p>\n<p>    math.cos(i)<\/p>\n<p>end_time = time.time()<\/p>\n<p>print(&quot;math\u5e93\u8ba1\u7b97\u65f6\u95f4\uff1a&quot;, end_time - start_time)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. <strong>numpy\u5e93\u7684\u6027\u80fd<\/strong><\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>import time<\/p>\n<p>angles = np.arange(1000000)<\/p>\n<p>start_time = time.time()<\/p>\n<p>np.cos(angles)<\/p>\n<p>end_time = time.time()<\/p>\n<p>print(&quot;numpy\u5e93\u8ba1\u7b97\u65f6\u95f4\uff1a&quot;, end_time - start_time)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e86Python\u4e2dcos\u51fd\u6570\u7684\u5b9a\u4e49\u548c\u4f7f\u7528\u65b9\u6cd5\u3002<strong>cos\u51fd\u6570\u662fmath\u5e93\u4e2d\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u7528\u4e8e\u8ba1\u7b97\u4e00\u4e2a\u89d2\u5ea6\u7684\u4f59\u5f26\u503c<\/strong>\u3002\u6211\u4eec\u8fd8\u4ecb\u7ecd\u4e86\u89d2\u5ea6\u5236\u4e0e\u5f27\u5ea6\u5236\u7684\u8f6c\u6362\u3001cos\u51fd\u6570\u7684\u5e94\u7528\u3001\u5176\u4ed6\u76f8\u5173\u7684\u4e09\u89d2\u51fd\u6570\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528numpy\u5e93\u8fdb\u884c\u9ad8\u7ea7\u8ba1\u7b97\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528Python\u4e2d\u7684cos\u51fd\u6570\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528cos\u51fd\u6570\u8fdb\u884c\u8ba1\u7b97\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0ccos\u51fd\u6570\u4e3b\u8981\u901a\u8fc7math\u6a21\u5757\u6765\u5b9e\u73b0\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u6765\u8c03\u7528cos\u51fd\u6570\u5e76\u8ba1\u7b97\u7ed9\u5b9a\u89d2\u5ea6\u7684\u4f59\u5f26\u503c\uff1a<\/p>\n<pre><code class=\"language-python\">import math\n\nangle_in_radians = math.radians(60)  # \u5c06\u89d2\u5ea6\u8f6c\u6362\u4e3a\u5f27\u5ea6\ncos_value = math.cos(angle_in_radians)\nprint(cos_value)  # \u8f93\u51fa\u7ed3\u679c\u4e3a0.5\n<\/code><\/pre>\n<p>\u8bf7\u6ce8\u610f\uff0ccos\u51fd\u6570\u63a5\u53d7\u7684\u662f\u5f27\u5ea6\u800c\u975e\u5ea6\u6570\uff0c\u56e0\u6b64\u9700\u8981\u8fdb\u884c\u76f8\u5e94\u7684\u8f6c\u6362\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u8ba1\u7b97\u4f59\u5f26\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u7ec6\u8282\uff1f<\/strong><br \/>\u5728\u4f7f\u7528cos\u51fd\u6570\u65f6\uff0c\u786e\u4fdd\u8f93\u5165\u7684\u89d2\u5ea6\u5355\u4f4d\u662f\u5f27\u5ea6\u3002\u5982\u679c\u4f60\u624b\u4e2d\u6709\u7684\u662f\u5ea6\u6570\uff0c\u8bb0\u5f97\u4f7f\u7528math.radians()\u5c06\u5176\u8f6c\u6362\u4e3a\u5f27\u5ea6\u3002\u6b64\u5916\uff0ccos\u51fd\u6570\u7684\u8fd4\u56de\u503c\u5728-1\u52301\u4e4b\u95f4\uff0c\u56e0\u6b64\u53ef\u4ee5\u6839\u636e\u8fd4\u56de\u503c\u6765\u5224\u65ad\u89d2\u5ea6\u7684\u6027\u8d28\u3002<\/p>\n<p><strong>\u6709\u6ca1\u6709\u5176\u4ed6Python\u5e93\u53ef\u4ee5\u66ff\u4ee3math\u6a21\u5757\u8fdb\u884c\u4f59\u5f26\u8ba1\u7b97\uff1f<\/strong><br \/>\u9664\u4e86math\u6a21\u5757\uff0cNumPy\u4e5f\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684\u5e93\uff0c\u5c24\u5176\u662f\u5728\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u4e2d\u3002\u5b83\u63d0\u4f9b\u4e86\u7c7b\u4f3c\u7684cos\u51fd\u6570\uff0c\u4e14\u652f\u6301\u6570\u7ec4\u8f93\u5165\uff0c\u9002\u5408\u4e8e\u6279\u91cf\u8ba1\u7b97\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">import numpy as np\n\nangles = np.array([0, 30, 60, 90])  # \u89d2\u5ea6\u6570\u7ec4\ncos_values = np.cos(np.radians(angles))  # \u8f6c\u6362\u4e3a\u5f27\u5ea6\u5e76\u8ba1\u7b97\u4f59\u5f26\nprint(cos_values)  # \u8f93\u51fa\u7ed3\u679c\u4e3a[ 1.  0.8660254 0.5  0.]\n<\/code><\/pre>\n<p>\u4f7f\u7528NumPy\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u5904\u7406\u591a\u4e2a\u89d2\u5ea6\u7684\u8ba1\u7b97\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0ccos\u51fd\u6570\u662f\u901a\u8fc7math\u5e93\u4e2d\u7684cos\u65b9\u6cd5\u6765\u5b9a\u4e49\u7684\u3001math\u5e93\u63d0\u4f9b\u4e86\u8bb8\u591a\u6570\u5b66\u51fd\u6570\u548c\u5e38\u91cf\u3001\u4f7f\u7528c [&hellip;]","protected":false},"author":3,"featured_media":1154991,"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\/1154984"}],"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=1154984"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1154984\/revisions"}],"predecessor-version":[{"id":1154994,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1154984\/revisions\/1154994"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1154991"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1154984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1154984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1154984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}