{"id":960585,"date":"2024-12-27T03:51:01","date_gmt":"2024-12-26T19:51:01","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/960585.html"},"modified":"2024-12-27T03:51:03","modified_gmt":"2024-12-26T19:51:03","slug":"python%e5%a6%82%e4%bd%95%e5%af%b9%e6%95%b0%e6%8d%ae%e5%be%ae%e5%88%86","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/960585.html","title":{"rendered":"python\u5982\u4f55\u5bf9\u6570\u636e\u5fae\u5206"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25103042\/d58d84d3-0a8c-41b8-9040-6451abcb1bf4.webp\" alt=\"python\u5982\u4f55\u5bf9\u6570\u636e\u5fae\u5206\" \/><\/p>\n<p><p> <strong>Python\u5bf9\u6570\u636e\u8fdb\u884c\u5fae\u5206\u7684\u65b9\u6cd5\u4e3b\u8981\u6709\uff1a\u4f7f\u7528NumPy\u8fdb\u884c\u6570\u503c\u5fae\u5206\u3001\u4f7f\u7528SciPy\u5e93\u4e2d\u7684\u5fae\u5206\u51fd\u6570\u3001\u5229\u7528SymPy\u8fdb\u884c\u7b26\u53f7\u5fae\u5206\u3002<\/strong>\u5728\u8fd9\u4e09\u79cd\u65b9\u6cd5\u4e2d\uff0cNumPy\u9002\u7528\u4e8e\u5904\u7406\u79bb\u6563\u7684\u6570\u636e\u96c6\uff0cSciPy\u63d0\u4f9b\u4e86\u66f4\u52a0\u7cbe\u786e\u7684\u6570\u503c\u5fae\u5206\u5de5\u5177\uff0c\u800cSymPy\u5219\u7528\u4e8e\u7b26\u53f7\u8ba1\u7b97\u548c\u89e3\u6790\u6c42\u5bfc\u3002\u63a5\u4e0b\u6765\uff0c\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e09\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001NUMPY\u8fdb\u884c\u6570\u503c\u5fae\u5206<\/p>\n<\/p>\n<p><p>NumPy\u662fPython\u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u503c\u8ba1\u7b97\u5e93\uff0c\u5b83\u53ef\u4ee5\u5904\u7406\u591a\u7ef4\u6570\u7ec4\u548c\u77e9\u9635\u8fd0\u7b97\u3002\u5728\u8fdb\u884c\u6570\u636e\u5fae\u5206\u65f6\uff0cNumPy\u7684<code>numpy.gradient()<\/code>\u51fd\u6570\u662f\u6700\u5e38\u7528\u7684\u5de5\u5177\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528<code>numpy.gradient()<\/code><\/strong><\/p>\n<\/p>\n<p><p><code>numpy.gradient()<\/code>\u51fd\u6570\u53ef\u4ee5\u8ba1\u7b97\u591a\u7ef4\u6570\u7ec4\u7684\u68af\u5ea6\uff0c\u5373\u5bf9\u6bcf\u4e2a\u7ef4\u5ea6\u8fdb\u884c\u6570\u503c\u5fae\u5206\u3002\u8be5\u51fd\u6570\u901a\u8fc7\u5dee\u5206\u6cd5\u8ba1\u7b97\u68af\u5ea6\uff0c\u5bf9\u4e8e\u4e00\u7ef4\u6570\u7ec4\uff0c\u5b83\u4f1a\u8fd4\u56de\u6bcf\u4e2a\u6570\u636e\u70b9\u7684\u5bfc\u6570\u8fd1\u4f3c\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u4e00\u7ef4\u6570\u7ec4<\/strong><\/h2>\n<p>x = np.linspace(0, 10, 100)<\/p>\n<p>y = np.sin(x)<\/p>\n<h2><strong>\u8ba1\u7b97\u68af\u5ea6<\/strong><\/h2>\n<p>dydx = np.gradient(y, x)<\/p>\n<h2><strong>\u8f93\u51fa\u7ed3\u679c<\/strong><\/h2>\n<p>print(dydx)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>numpy.gradient()<\/code>\u8ba1\u7b97\u4e86<code>sin(x)<\/code>\u51fd\u6570\u5728\u6bcf\u4e2a\u70b9\u7684\u5bfc\u6570\uff0c\u7ed3\u679c\u5b58\u50a8\u5728<code>dydx<\/code>\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5dee\u5206\u6cd5\u8ba1\u7b97<\/strong><\/p>\n<\/p>\n<p><p>NumPy\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5dee\u5206\u6cd5\u624b\u52a8\u8ba1\u7b97\u5fae\u5206\u3002\u5dee\u5206\u6cd5\u662f\u4e00\u79cd\u7b80\u5355\u7684\u6570\u503c\u5fae\u5206\u65b9\u6cd5\uff0c\u53ef\u4ee5\u901a\u8fc7\u8ba1\u7b97\u76f8\u90bb\u6570\u636e\u70b9\u7684\u5dee\u503c\u6765\u8fd1\u4f3c\u5bfc\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">dy = np.diff(y)<\/p>\n<p>dx = np.diff(x)<\/p>\n<p>dydx_manual = dy \/ dx<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u7b80\u5355\u7684\u6570\u503c\u5fae\u5206\uff0c\u4f46\u5728\u6570\u636e\u70b9\u4e0d\u591f\u5bc6\u96c6\u65f6\u53ef\u80fd\u4e0d\u591f\u7cbe\u786e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001SCIPY\u5e93\u4e2d\u7684\u5fae\u5206\u51fd\u6570<\/p>\n<\/p>\n<p><p>SciPy\u662fPython\u79d1\u5b66\u8ba1\u7b97\u7684\u6838\u5fc3\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u6570\u503c\u8ba1\u7b97\u5de5\u5177\uff0c\u5305\u62ec\u5fae\u5206\u3001\u79ef\u5206\u548c\u4f18\u5316\u7b49\u3002\u5728SciPy\u4e2d\uff0c<code>scipy.misc.derivative()<\/code>\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u8ba1\u7b97\u51fd\u6570\u7684\u6570\u503c\u5bfc\u6570\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528<code>scipy.misc.derivative()<\/code><\/strong><\/p>\n<\/p>\n<p><p><code>scipy.misc.derivative()<\/code>\u51fd\u6570\u53ef\u4ee5\u8ba1\u7b97\u4e00\u7ef4\u51fd\u6570\u5728\u7ed9\u5b9a\u70b9\u7684\u5bfc\u6570\u3002\u8be5\u51fd\u6570\u91c7\u7528\u6709\u9650\u5dee\u5206\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6307\u5b9a\u5dee\u5206\u95f4\u9694\u548c\u5bfc\u6570\u9636\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy.misc import derivative<\/p>\n<h2><strong>\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570<\/strong><\/h2>\n<p>def f(x):<\/p>\n<p>    return np.sin(x)<\/p>\n<h2><strong>\u8ba1\u7b97\u51fd\u6570\u5728\u70b9pi\u5904\u7684\u5bfc\u6570<\/strong><\/h2>\n<p>df_dx = derivative(f, np.pi, dx=1e-6)<\/p>\n<p>print(df_dx)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>scipy.misc.derivative()<\/code>\u8ba1\u7b97\u4e86<code>sin(x)<\/code>\u5728<code>x=pi<\/code>\u5904\u7684\u5bfc\u6570\uff0c\u7ed3\u679c\u63a5\u8fd1\u4e8e<code>-1<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9ad8\u9636\u5fae\u5206<\/strong><\/p>\n<\/p>\n<p><p><code>scipy.misc.derivative()<\/code>\u8fd8\u652f\u6301\u8ba1\u7b97\u9ad8\u9636\u5bfc\u6570\uff0c\u53ea\u9700\u901a\u8fc7<code>n<\/code>\u53c2\u6570\u6307\u5b9a\u5bfc\u6570\u7684\u9636\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8ba1\u7b97\u4e8c\u9636\u5bfc\u6570<\/p>\n<p>d2f_dx2 = derivative(f, np.pi, dx=1e-6, n=2)<\/p>\n<p>print(d2f_dx2)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u5bf9\u4e8e\u9700\u8981\u8ba1\u7b97\u9ad8\u9636\u5bfc\u6570\u7684\u60c5\u51b5\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001SYMPY\u8fdb\u884c\u7b26\u53f7\u5fae\u5206<\/p>\n<\/p>\n<p><p>SymPy\u662fPython\u7684\u7b26\u53f7\u8ba1\u7b97\u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u7b26\u53f7\u5fae\u5206\uff0c\u5373\u89e3\u6790\u6c42\u5bfc\u3002\u5b83\u9002\u7528\u4e8e\u9700\u8981\u7cbe\u786e\u8868\u8fbe\u5bfc\u6570\u516c\u5f0f\u7684\u573a\u5408\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7b26\u53f7\u53d8\u91cf\u548c\u8868\u8fbe\u5f0f<\/strong><\/p>\n<\/p>\n<p><p>\u5728SymPy\u4e2d\uff0c\u9996\u5148\u9700\u8981\u5b9a\u4e49\u7b26\u53f7\u53d8\u91cf\uff0c\u7136\u540e\u521b\u5efa\u7b26\u53f7\u8868\u8fbe\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sympy import symbols, sin, diff<\/p>\n<h2><strong>\u5b9a\u4e49\u7b26\u53f7\u53d8\u91cf<\/strong><\/h2>\n<p>x = symbols(&#39;x&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u7b26\u53f7\u8868\u8fbe\u5f0f<\/strong><\/h2>\n<p>expr = sin(x)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528<code>diff()<\/code>\u51fd\u6570<\/strong><\/p>\n<\/p>\n<p><p>SymPy\u7684<code>diff()<\/code>\u51fd\u6570\u7528\u4e8e\u8ba1\u7b97\u7b26\u53f7\u8868\u8fbe\u5f0f\u7684\u5bfc\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8ba1\u7b97\u5bfc\u6570<\/p>\n<p>derivative_expr = diff(expr, x)<\/p>\n<p>print(derivative_expr)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>diff()<\/code>\u8ba1\u7b97\u4e86<code>sin(x)<\/code>\u7684\u5bfc\u6570\uff0c\u7ed3\u679c\u4e3a<code>cos(x)<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9ad8\u9636\u7b26\u53f7\u5fae\u5206<\/strong><\/p>\n<\/p>\n<p><p>SymPy\u7684<code>diff()<\/code>\u51fd\u6570\u4e5f\u652f\u6301\u9ad8\u9636\u5fae\u5206\uff0c\u53ea\u9700\u901a\u8fc7\u7b2c\u4e8c\u4e2a\u53c2\u6570\u6307\u5b9a\u5bfc\u6570\u7684\u9636\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8ba1\u7b97\u4e8c\u9636\u5bfc\u6570<\/p>\n<p>second_derivative_expr = diff(expr, x, 2)<\/p>\n<p>print(second_derivative_expr)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u7b26\u53f7\u8ba1\u7b97\u65b9\u6cd5\u53ef\u4ee5\u5f97\u5230\u7cbe\u786e\u7684\u5bfc\u6570\u8868\u8fbe\u5f0f\uff0c\u975e\u5e38\u9002\u5408\u9700\u8981\u89e3\u6790\u6c42\u5bfc\u7684\u573a\u5408\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u6570\u636e\u5fae\u5206\u7684\u5e94\u7528\u573a\u666f<\/p>\n<\/p>\n<p><p>\u6570\u636e\u5fae\u5206\u5728\u79d1\u5b66\u8ba1\u7b97\u3001\u5de5\u7a0b\u5206\u6790\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u7b49\u9886\u57df\u6709\u5e7f\u6cdb\u5e94\u7528\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5178\u578b\u7684\u5e94\u7528\u573a\u666f\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7269\u7406\u4eff\u771f<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u7269\u7406\u4eff\u771f\u4e2d\uff0c\u5fae\u5206\u7528\u4e8e\u8ba1\u7b97\u901f\u5ea6\u3001\u52a0\u901f\u5ea6\u7b49\u7269\u7406\u91cf\u3002\u4f8b\u5982\uff0c\u7ed9\u5b9a\u4f4d\u79fb\u968f\u65f6\u95f4\u7684\u53d8\u5316\uff0c\u53ef\u4ee5\u901a\u8fc7\u5fae\u5206\u5f97\u5230\u901f\u5ea6\u548c\u52a0\u901f\u5ea6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4fe1\u53f7\u5904\u7406<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4fe1\u53f7\u5904\u7406\u4e2d\uff0c\u5fae\u5206\u7528\u4e8e\u8fb9\u7f18\u68c0\u6d4b\u3001\u7279\u5f81\u63d0\u53d6\u7b49\u3002\u4f8b\u5982\uff0c\u5728\u56fe\u50cf\u5904\u7406\u4e2d\uff0c\u5fae\u5206\u53ef\u4ee5\u5e2e\u52a9\u68c0\u6d4b\u56fe\u50cf\u7684\u8fb9\u7f18\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u673a\u5668\u5b66\u4e60<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u673a\u5668\u5b66\u4e60\u4e2d\uff0c\u5fae\u5206\u7528\u4e8e\u8ba1\u7b97\u635f\u5931\u51fd\u6570\u7684\u68af\u5ea6\uff0c\u4ece\u800c\u8fdb\u884c\u6a21\u578b\u4f18\u5316\u3002\u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u5c31\u662f\u901a\u8fc7\u5fae\u5206\u8ba1\u7b97\u635f\u5931\u51fd\u6570\u76f8\u5bf9\u4e8e\u6a21\u578b\u53c2\u6570\u7684\u68af\u5ea6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u9009\u62e9\u5408\u9002\u7684\u5fae\u5206\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>\u5728\u9009\u62e9\u5fae\u5206\u65b9\u6cd5\u65f6\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u60c5\u51b5\u8fdb\u884c\u9009\u62e9\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6570\u636e\u89c4\u6a21<\/strong><\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u5927\u89c4\u6a21\u7684\u6570\u503c\u6570\u636e\uff0cNumPy\u548cSciPy\u63d0\u4f9b\u7684\u6570\u503c\u5fae\u5206\u65b9\u6cd5\u6548\u7387\u8f83\u9ad8\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7cbe\u5ea6\u8981\u6c42<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u9ad8\u7cbe\u5ea6\u7684\u89e3\u6790\u89e3\uff0cSymPy\u7684\u7b26\u53f7\u5fae\u5206\u65b9\u6cd5\u662f\u5408\u9002\u7684\u9009\u62e9\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8ba1\u7b97\u590d\u6742\u5ea6<\/strong><\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u590d\u6742\u51fd\u6570\u6216\u9700\u8981\u9ad8\u9636\u5fae\u5206\u7684\u60c5\u51b5\uff0cSciPy\u7684\u9ad8\u9636\u5bfc\u6570\u8ba1\u7b97\u529f\u80fd\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u76f8\u4fe1\u5927\u5bb6\u5bf9Python\u4e2d\u8fdb\u884c\u6570\u636e\u5fae\u5206\u7684\u65b9\u6cd5\u6709\u4e86\u66f4\u6df1\u5165\u7684\u4e86\u89e3\u3002\u65e0\u8bba\u662f\u6570\u503c\u5fae\u5206\u8fd8\u662f\u7b26\u53f7\u5fae\u5206\uff0cPython\u90fd\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5de5\u5177\u6765\u6ee1\u8db3\u4e0d\u540c\u7684\u8ba1\u7b97\u9700\u6c42\u3002\u6839\u636e\u5177\u4f53\u5e94\u7528\u573a\u666f\uff0c\u9009\u62e9\u5408\u9002\u7684\u5fae\u5206\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u8ba1\u7b97\u6548\u7387\u548c\u7cbe\u5ea6\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u6570\u636e\u5fae\u5206\u7684\u529f\u80fd\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528NumPy\u548cSciPy\u5e93\u6765\u5b9e\u73b0\u6570\u636e\u7684\u5fae\u5206\u3002NumPy\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u6570\u7ec4\u64cd\u4f5c\uff0c\u800cSciPy\u5219\u63d0\u4f9b\u4e86\u66f4\u4e3a\u590d\u6742\u7684\u6570\u5b66\u529f\u80fd\u3002\u4f7f\u7528<code>numpy.gradient()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u8ba1\u7b97\u6570\u7ec4\u7684\u79bb\u6563\u5dee\u5206\uff0c\u4ece\u800c\u5b9e\u73b0\u5fae\u5206\u3002\u5982\u679c\u9700\u8981\u66f4\u9ad8\u7cbe\u5ea6\u7684\u5fae\u5206\uff0c\u53ef\u4ee5\u4f7f\u7528SciPy\u4e2d\u7684<code>scipy.misc.derivative()<\/code>\u51fd\u6570\u3002<\/p>\n<p><strong>\u6570\u636e\u5fae\u5206\u5bf9\u6570\u636e\u5206\u6790\u6709\u4ec0\u4e48\u5e2e\u52a9\uff1f<\/strong><br \/>\u6570\u636e\u5fae\u5206\u5728\u6570\u636e\u5206\u6790\u4e2d\u975e\u5e38\u91cd\u8981\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u8bc6\u522b\u6570\u636e\u7684\u53d8\u5316\u7387\u548c\u8d8b\u52bf\u3002\u901a\u8fc7\u5fae\u5206\uff0c\u5206\u6790\u5e08\u53ef\u4ee5\u66f4\u6e05\u6670\u5730\u4e86\u89e3\u6570\u636e\u968f\u65f6\u95f4\u7684\u53d8\u5316\uff0c\u53d1\u73b0\u6f5c\u5728\u7684\u6a21\u5f0f\u6216\u5f02\u5e38\u3002\u6b64\u5916\uff0c\u5fae\u5206\u5728\u7269\u7406\u5b66\u3001\u5de5\u7a0b\u5b66\u548c\u7ecf\u6d4e\u5b66\u7b49\u9886\u57df\u4e5f\u8d77\u7740\u5173\u952e\u4f5c\u7528\uff0c\u5e2e\u52a9\u5206\u6790\u52a8\u6001\u7cfb\u7edf\u7684\u884c\u4e3a\u3002<\/p>\n<p><strong>\u5728\u5904\u7406\u566a\u58f0\u6570\u636e\u65f6\uff0c\u5982\u4f55\u63d0\u9ad8\u5fae\u5206\u7ed3\u679c\u7684\u51c6\u786e\u6027\uff1f<\/strong><br \/>\u5904\u7406\u566a\u58f0\u6570\u636e\u65f6\uff0c\u53ef\u4ee5\u91c7\u7528\u5e73\u6ed1\u6280\u672f\u6765\u63d0\u9ad8\u5fae\u5206\u7ed3\u679c\u7684\u51c6\u786e\u6027\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u79fb\u52a8\u5e73\u5747\u6216\u9ad8\u65af\u6ee4\u6ce2\u7b49\u65b9\u6cd5\u5bf9\u6570\u636e\u8fdb\u884c\u9884\u5904\u7406\uff0c\u4ee5\u51cf\u5c11\u566a\u58f0\u5bf9\u5fae\u5206\u7ed3\u679c\u7684\u5f71\u54cd\u3002\u6b64\u5916\uff0c\u9009\u62e9\u5408\u9002\u7684\u5fae\u5206\u7b97\u6cd5\u548c\u53c2\u6570\u4e5f\u80fd\u663e\u8457\u63d0\u5347\u7ed3\u679c\u7684\u53ef\u9760\u6027\u3002\u4f7f\u7528SciPy\u7684<code>scipy.signal.savgol_filter()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u5e73\u6ed1\u6570\u636e\u5e76\u8fdb\u884c\u5fae\u5206\uff0c\u5f97\u5230\u66f4\u4e3a\u7cbe\u51c6\u7684\u7ed3\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5bf9\u6570\u636e\u8fdb\u884c\u5fae\u5206\u7684\u65b9\u6cd5\u4e3b\u8981\u6709\uff1a\u4f7f\u7528NumPy\u8fdb\u884c\u6570\u503c\u5fae\u5206\u3001\u4f7f\u7528SciPy\u5e93\u4e2d\u7684\u5fae\u5206\u51fd\u6570\u3001\u5229\u7528SymP [&hellip;]","protected":false},"author":3,"featured_media":960593,"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\/960585"}],"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=960585"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/960585\/revisions"}],"predecessor-version":[{"id":960594,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/960585\/revisions\/960594"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/960593"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=960585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=960585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=960585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}