{"id":1121688,"date":"2025-01-08T19:12:20","date_gmt":"2025-01-08T11:12:20","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1121688.html"},"modified":"2025-01-08T19:12:24","modified_gmt":"2025-01-08T11:12:24","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8python%e8%bf%9b%e8%a1%8c%e6%95%b0%e5%ad%a6%e8%ae%a1%e7%ae%97%e6%9c%ba","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1121688.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528python\u8fdb\u884c\u6570\u5b66\u8ba1\u7b97\u673a"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25083815\/2e9788cd-2a0f-4c1d-83ac-5a57dd9ec464.webp\" alt=\"\u5982\u4f55\u4f7f\u7528python\u8fdb\u884c\u6570\u5b66\u8ba1\u7b97\u673a\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u8fdb\u884c\u6570\u5b66\u8ba1\u7b97\u7684\u6838\u5fc3\u8981\u70b9\u662f\uff1aPython\u5177\u6709\u4e30\u5bcc\u7684\u6570\u5b66\u5e93\u3001\u7075\u6d3b\u7684\u8bed\u6cd5\u3001\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u5de5\u5177\u3001\u826f\u597d\u7684\u53ef\u6269\u5c55\u6027\u3002<\/strong> \u5176\u4e2d\uff0cPython\u7684\u6570\u5b66\u5e93\u5982NumPy\u548cSciPy\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6570\u5b66\u8ba1\u7b97\u529f\u80fd\uff0c\u662f\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u7684\u57fa\u7840\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5229\u7528\u8fd9\u4e9b\u5de5\u5177\u8fdb\u884c\u6570\u5b66\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001Python\u6570\u5b66\u5e93\u6982\u8ff0<\/h3>\n<\/p>\n<p><p>Python\u7684\u6570\u5b66\u5e93\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>NumPy<\/strong><\/li>\n<li><strong>SciPy<\/strong><\/li>\n<li><strong>SymPy<\/strong><\/li>\n<li><strong>Matplotlib<\/strong><\/li>\n<li><strong>Pandas<\/strong><\/li>\n<\/ol>\n<p><h4>1. NumPy<\/h4>\n<\/p>\n<p><p>NumPy\u662fPython\u4e2d\u6700\u57fa\u7840\u7684\u79d1\u5b66\u8ba1\u7b97\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u652f\u6301\u591a\u7ef4\u6570\u7ec4\u5bf9\u8c61\u7684\u5f3a\u5927\u529f\u80fd\u3002NumPy\u7684\u6838\u5fc3\u662fndarray\u5bf9\u8c61\uff0c\u5b83\u662f\u4e00\u79cd\u540c\u7c7b\u6570\u636e\u7c7b\u578b\u7684\u591a\u7ef4\u6570\u7ec4\u3002\u901a\u8fc7NumPy\uff0c\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u5411\u91cf\u548c\u77e9\u9635\u8fd0\u7b97\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2aNumPy\u6570\u7ec4\uff1a<\/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>arr = np.array([1, 2, 3, 4, 5])<\/p>\n<p>print(arr)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4<\/strong><\/h2>\n<p>arr_2d = np.array([[1, 2, 3], [4, 5, 6]])<\/p>\n<p>print(arr_2d)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>NumPy\u8fd8\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u6570\u5b66\u51fd\u6570\uff0c\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6c42\u6570\u7ec4\u7684\u5747\u503c<\/p>\n<p>mean_value = np.mean(arr)<\/p>\n<p>print(mean_value)<\/p>\n<h2><strong>\u8ba1\u7b97\u6570\u7ec4\u7684\u6807\u51c6\u5dee<\/strong><\/h2>\n<p>std_value = np.std(arr)<\/p>\n<p>print(std_value)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. SciPy<\/h4>\n<\/p>\n<p><p>SciPy\u662f\u57fa\u4e8eNumPy\u6784\u5efa\u7684\uff0c\u5b83\u96c6\u6210\u4e86\u66f4\u591a\u7684\u79d1\u5b66\u8ba1\u7b97\u529f\u80fd\uff0c\u5305\u62ec\u6570\u503c\u79ef\u5206\u3001\u4f18\u5316\u3001\u7ebf\u6027\u4ee3\u6570\u3001\u7edf\u8ba1\u7b49\u3002SciPy\u5e93\u7684\u6a21\u5757\u6db5\u76d6\u4e86\u4ece\u6700\u57fa\u672c\u7684\u6570\u5b66\u8fd0\u7b97\u5230\u590d\u6742\u7684\u79d1\u5b66\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528SciPy\u8fdb\u884c\u6570\u503c\u79ef\u5206\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy import integrate<\/p>\n<h2><strong>\u5b9a\u4e49\u88ab\u79ef\u51fd\u6570<\/strong><\/h2>\n<p>def f(x):<\/p>\n<p>    return x2<\/p>\n<h2><strong>\u8ba1\u7b97\u5b9a\u79ef\u5206<\/strong><\/h2>\n<p>result, error = integrate.quad(f, 0, 1)<\/p>\n<p>print(result)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. SymPy<\/h4>\n<\/p>\n<p><p>SymPy\u662fPython\u7684\u7b26\u53f7\u6570\u5b66\u5e93\uff0c\u5b83\u5141\u8bb8\u7528\u6237\u8fdb\u884c\u7b26\u53f7\u8ba1\u7b97\uff0c\u5982\u4ee3\u6570\u8868\u8fbe\u5f0f\u7684\u7b80\u5316\u3001\u5fae\u79ef\u5206\u3001\u77e9\u9635\u8fd0\u7b97\u7b49\u3002SymPy\u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u53ef\u4ee5\u5904\u7406\u7b26\u53f7\u8868\u8fbe\u5f0f\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u6570\u503c\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u7b26\u53f7\u8ba1\u7b97\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sympy import symbols, diff<\/p>\n<h2><strong>\u5b9a\u4e49\u7b26\u53f7\u53d8\u91cf<\/strong><\/h2>\n<p>x = symbols(&#39;x&#39;)<\/p>\n<h2><strong>\u5b9a\u4e49\u7b26\u53f7\u51fd\u6570<\/strong><\/h2>\n<p>f = x2 + 2*x + 1<\/p>\n<h2><strong>\u8ba1\u7b97\u5bfc\u6570<\/strong><\/h2>\n<p>derivative = diff(f, x)<\/p>\n<p>print(derivative)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. Matplotlib<\/h4>\n<\/p>\n<p><p>Matplotlib\u662fPython\u4e2d\u7684\u7ed8\u56fe\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6570\u636e\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u80fd\u591f\u751f\u6210\u5404\u79cd\u56fe\u5f62\u548c\u56fe\u8868\u3002\u5bf9\u4e8e\u6570\u5b66\u8ba1\u7b97\u7ed3\u679c\u7684\u53ef\u89c6\u5316\uff0cMatplotlib\u662f\u975e\u5e38\u6709\u7528\u7684\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u7ed8\u5236\u51fd\u6570\u56fe\u50cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u51fd\u6570<\/strong><\/h2>\n<p>def f(x):<\/p>\n<p>    return np.sin(x)<\/p>\n<h2><strong>\u751f\u6210x\u6570\u636e<\/strong><\/h2>\n<p>x = np.linspace(0, 10, 100)<\/p>\n<h2><strong>\u751f\u6210y\u6570\u636e<\/strong><\/h2>\n<p>y = f(x)<\/p>\n<h2><strong>\u7ed8\u5236\u56fe\u50cf<\/strong><\/h2>\n<p>plt.plot(x, y)<\/p>\n<p>plt.xlabel(&#39;x&#39;)<\/p>\n<p>plt.ylabel(&#39;f(x)&#39;)<\/p>\n<p>plt.title(&#39;Function Plot&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>5. Pandas<\/h4>\n<\/p>\n<p><p>Pandas\u662fPython\u4e2d\u7684\u6570\u636e\u5206\u6790\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u548c\u6570\u636e\u5206\u6790\u5de5\u5177\uff0c\u5c24\u5176\u9002\u7528\u4e8e\u5904\u7406\u548c\u5206\u6790\u5927\u578b\u6570\u636e\u96c6\u3002Pandas\u7684DataFrame\u5bf9\u8c61\u7c7b\u4f3c\u4e8eExcel\u8868\u683c\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u7b5b\u9009\u3001\u805a\u5408\u548c\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528Pandas\u8fdb\u884c\u6570\u636e\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u521b\u5efaDataFrame<\/strong><\/h2>\n<p>data = {&#39;A&#39;: [1, 2, 3], &#39;B&#39;: [4, 5, 6]}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>print(df)<\/p>\n<h2><strong>\u8ba1\u7b97\u6bcf\u5217\u7684\u5747\u503c<\/strong><\/h2>\n<p>mean_values = df.mean()<\/p>\n<p>print(mean_values)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001Python\u8fdb\u884c\u57fa\u672c\u6570\u5b66\u8ba1\u7b97<\/h3>\n<\/p>\n<p><p>Python\u7684\u5185\u7f6e\u6570\u5b66\u8fd0\u7b97\u7b26\u548c\u51fd\u6570\u6db5\u76d6\u4e86\u52a0\u51cf\u4e58\u9664\u3001\u5e42\u8fd0\u7b97\u3001\u53d6\u6574\u3001\u4f59\u6570\u7b49\u57fa\u672c\u64cd\u4f5c\u3002Python\u7684math\u6a21\u5757\u8fd8\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u6570\u5b66\u51fd\u6570\u548c\u5e38\u6570\u3002<\/p>\n<\/p>\n<p><h4>1. \u57fa\u672c\u8fd0\u7b97<\/h4>\n<\/p>\n<p><p>Python\u652f\u6301\u57fa\u672c\u7684\u6570\u5b66\u8fd0\u7b97\u7b26\uff0c\u5982\u52a0\uff08+\uff09\u3001\u51cf\uff08-\uff09\u3001\u4e58\uff08*\uff09\u3001\u9664\uff08\/\uff09\u3001\u5e42\uff08\uff09\u3001\u53d6\u6574\uff08\/\/\uff09\u3001\u4f59\u6570\uff08%\uff09\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u57fa\u672c\u8fd0\u7b97<\/p>\n<p>a = 10<\/p>\n<p>b = 3<\/p>\n<p>print(a + b)  # \u52a0\u6cd5<\/p>\n<p>print(a - b)  # \u51cf\u6cd5<\/p>\n<p>print(a * b)  # \u4e58\u6cd5<\/p>\n<p>print(a \/ b)  # \u9664\u6cd5<\/p>\n<p>print(a  b)  # \u5e42\u8fd0\u7b97<\/p>\n<p>print(a \/\/ b)  # \u53d6\u6574<\/p>\n<p>print(a % b)  # \u4f59\u6570<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u6570\u5b66\u51fd\u6570\u548c\u5e38\u6570<\/h4>\n<\/p>\n<p><p>Python\u7684math\u6a21\u5757\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u6570\u5b66\u51fd\u6570\u548c\u5e38\u6570\uff0c\u5982\u4e09\u89d2\u51fd\u6570\u3001\u6307\u6570\u548c\u5bf9\u6570\u51fd\u6570\u3001\u5e38\u6570\u5982\u03c0\u548ce\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<h2><strong>\u4f7f\u7528math\u6a21\u5757<\/strong><\/h2>\n<p>print(math.pi)  # \u5706\u5468\u7387<\/p>\n<p>print(math.e)  # \u81ea\u7136\u5e38\u6570<\/p>\n<p>print(math.sqrt(16))  # \u5e73\u65b9\u6839<\/p>\n<p>print(math.log(100, 10))  # \u5bf9\u6570<\/p>\n<p>print(math.sin(math.pi \/ 2))  # \u6b63\u5f26\u51fd\u6570<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001Python\u8fdb\u884c\u9ad8\u7ea7\u6570\u5b66\u8ba1\u7b97<\/h3>\n<\/p>\n<p><p>\u9ad8\u7ea7\u6570\u5b66\u8ba1\u7b97\u5305\u62ec\u77e9\u9635\u8fd0\u7b97\u3001\u5fae\u79ef\u5206\u3001\u7edf\u8ba1\u5206\u6790\u7b49\uff0c\u8fd9\u4e9b\u8ba1\u7b97\u901a\u5e38\u9700\u8981\u501f\u52a9NumPy\u3001SciPy\u548cSymPy\u7b49\u5e93\u6765\u5b8c\u6210\u3002<\/p>\n<\/p>\n<p><h4>1. \u77e9\u9635\u8fd0\u7b97<\/h4>\n<\/p>\n<p><p>NumPy\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u77e9\u9635\u8fd0\u7b97\u529f\u80fd\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u77e9\u9635\u7684\u52a0\u51cf\u4e58\u9664\u3001\u8f6c\u7f6e\u3001\u9006\u77e9\u9635\u7b49\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u77e9\u9635\u8fd0\u7b97\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u77e9\u9635<\/strong><\/h2>\n<p>matrix_a = np.array([[1, 2], [3, 4]])<\/p>\n<p>matrix_b = np.array([[5, 6], [7, 8]])<\/p>\n<h2><strong>\u77e9\u9635\u52a0\u6cd5<\/strong><\/h2>\n<p>matrix_add = matrix_a + matrix_b<\/p>\n<p>print(matrix_add)<\/p>\n<h2><strong>\u77e9\u9635\u4e58\u6cd5<\/strong><\/h2>\n<p>matrix_mul = np.dot(matrix_a, matrix_b)<\/p>\n<p>print(matrix_mul)<\/p>\n<h2><strong>\u77e9\u9635\u8f6c\u7f6e<\/strong><\/h2>\n<p>matrix_transpose = np.transpose(matrix_a)<\/p>\n<p>print(matrix_transpose)<\/p>\n<h2><strong>\u9006\u77e9\u9635<\/strong><\/h2>\n<p>matrix_inv = np.linalg.inv(matrix_a)<\/p>\n<p>print(matrix_inv)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u5fae\u79ef\u5206<\/h4>\n<\/p>\n<p><p>SymPy\u53ef\u4ee5\u8fdb\u884c\u7b26\u53f7\u5fae\u79ef\u5206\u8fd0\u7b97\uff0cNumPy\u548cSciPy\u5219\u63d0\u4f9b\u4e86\u6570\u503c\u5fae\u79ef\u5206\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528SymPy\u8fdb\u884c\u7b26\u53f7\u5fae\u79ef\u5206\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sympy import symbols, integrate, diff<\/p>\n<h2><strong>\u5b9a\u4e49\u7b26\u53f7\u53d8\u91cf<\/strong><\/h2>\n<p>x = symbols(&#39;x&#39;)<\/p>\n<h2><strong>\u5b9a\u4e49\u51fd\u6570<\/strong><\/h2>\n<p>f = x2 + 2*x + 1<\/p>\n<h2><strong>\u6c42\u5bfc\u6570<\/strong><\/h2>\n<p>derivative = diff(f, x)<\/p>\n<p>print(derivative)<\/p>\n<h2><strong>\u6c42\u79ef\u5206<\/strong><\/h2>\n<p>integral = integrate(f, x)<\/p>\n<p>print(integral)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528SciPy\u8fdb\u884c\u6570\u503c\u5fae\u79ef\u5206\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy import integrate<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u88ab\u79ef\u51fd\u6570<\/strong><\/h2>\n<p>def f(x):<\/p>\n<p>    return np.sin(x)<\/p>\n<h2><strong>\u6570\u503c\u79ef\u5206<\/strong><\/h2>\n<p>result, error = integrate.quad(f, 0, np.pi)<\/p>\n<p>print(result)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u7edf\u8ba1\u5206\u6790<\/h4>\n<\/p>\n<p><p>NumPy\u548cPandas\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u7edf\u8ba1\u5206\u6790\u5de5\u5177\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u7684\u63cf\u8ff0\u7edf\u8ba1\u3001\u56de\u5f52\u5206\u6790\u3001\u5047\u8bbe\u68c0\u9a8c\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528Pandas\u8fdb\u884c\u63cf\u8ff0\u7edf\u8ba1\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u521b\u5efaDataFrame<\/strong><\/h2>\n<p>data = {&#39;A&#39;: [1, 2, 3, 4, 5], &#39;B&#39;: [5, 6, 7, 8, 9]}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<h2><strong>\u8ba1\u7b97\u63cf\u8ff0\u7edf\u8ba1\u91cf<\/strong><\/h2>\n<p>mean_values = df.mean()<\/p>\n<p>std_values = df.std()<\/p>\n<p>print(mean_values)<\/p>\n<p>print(std_values)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528NumPy\u8fdb\u884c\u56de\u5f52\u5206\u6790\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u6570\u636e<\/strong><\/h2>\n<p>x = np.array([1, 2, 3, 4, 5])<\/p>\n<p>y = np.array([2, 3, 5, 7, 11])<\/p>\n<h2><strong>\u7ebf\u6027\u56de\u5f52<\/strong><\/h2>\n<p>coefficients = np.polyfit(x, y, 1)<\/p>\n<p>print(coefficients)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001Python\u8fdb\u884c\u6570\u503c\u6a21\u62df<\/h3>\n<\/p>\n<p><p>\u6570\u503c\u6a21\u62df\u662f\u4e00\u79cd\u5229\u7528\u8ba1\u7b97\u673a\u8fdb\u884c\u6570\u5b66\u6a21\u578b\u6c42\u89e3\u7684\u65b9\u6cd5\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u7269\u7406\u3001\u5de5\u7a0b\u3001\u7ecf\u6d4e\u7b49\u9886\u57df\u3002Python\u7684NumPy\u3001SciPy\u3001Matplotlib\u7b49\u5e93\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6570\u503c\u6a21\u62df\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><h4>1. \u5e38\u5fae\u5206\u65b9\u7a0b\u6c42\u89e3<\/h4>\n<\/p>\n<p><p>SciPy\u7684integrate\u6a21\u5757\u63d0\u4f9b\u4e86\u5e38\u5fae\u5206\u65b9\u7a0b\uff08ODE\uff09\u7684\u6c42\u89e3\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u6a21\u62df\u52a8\u6001\u7cfb\u7edf\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528SciPy\u6c42\u89e3\u5e38\u5fae\u5206\u65b9\u7a0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from scipy.integrate import odeint<\/p>\n<p>import numpy as np<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u5b9a\u4e49\u5fae\u5206\u65b9\u7a0b<\/strong><\/h2>\n<p>def model(y, t):<\/p>\n<p>    dydt = -y + np.sin(t)<\/p>\n<p>    return dydt<\/p>\n<h2><strong>\u521d\u59cb\u6761\u4ef6<\/strong><\/h2>\n<p>y0 = 0<\/p>\n<h2><strong>\u65f6\u95f4\u70b9<\/strong><\/h2>\n<p>t = np.linspace(0, 10, 100)<\/p>\n<h2><strong>\u6c42\u89e3\u5fae\u5206\u65b9\u7a0b<\/strong><\/h2>\n<p>solution = odeint(model, y0, t)<\/p>\n<h2><strong>\u7ed8\u5236\u89e3\u7684\u56fe\u50cf<\/strong><\/h2>\n<p>plt.plot(t, solution)<\/p>\n<p>plt.xlabel(&#39;Time&#39;)<\/p>\n<p>plt.ylabel(&#39;y(t)&#39;)<\/p>\n<p>plt.title(&#39;ODE Solution&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u504f\u5fae\u5206\u65b9\u7a0b\u6c42\u89e3<\/h4>\n<\/p>\n<p><p>\u504f\u5fae\u5206\u65b9\u7a0b\uff08PDE\uff09\u7684\u6c42\u89e3\u66f4\u4e3a\u590d\u6742\uff0c\u901a\u5e38\u9700\u8981\u501f\u52a9\u6570\u503c\u65b9\u6cd5\u548c\u4e13\u4e1a\u8f6f\u4ef6\u3002Python\u7684FEniCS\u3001FiPy\u7b49\u5e93\u63d0\u4f9b\u4e86PDE\u6c42\u89e3\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528FiPy\u6c42\u89e3\u504f\u5fae\u5206\u65b9\u7a0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from fipy import CellVariable, Grid1D, TransientTerm, DiffusionTerm, Viewer<\/p>\n<h2><strong>\u521b\u5efa\u7f51\u683c<\/strong><\/h2>\n<p>nx = 50<\/p>\n<p>dx = 1.0<\/p>\n<p>mesh = Grid1D(nx=nx, dx=dx)<\/p>\n<h2><strong>\u5b9a\u4e49\u53d8\u91cf<\/strong><\/h2>\n<p>phi = CellVariable(name=&quot;solution variable&quot;, mesh=mesh, value=0.0)<\/p>\n<h2><strong>\u521d\u59cb\u6761\u4ef6<\/strong><\/h2>\n<p>phi.setValue(1.0, where=mesh.cellCenters[0] &gt; 5)<\/p>\n<h2><strong>\u5b9a\u4e49\u65b9\u7a0b<\/strong><\/h2>\n<p>D = 1.0  # \u6269\u6563\u7cfb\u6570<\/p>\n<p>eq = TransientTerm() == DiffusionTerm(coeff=D)<\/p>\n<h2><strong>\u8bbe\u7f6e\u8fb9\u754c\u6761\u4ef6<\/strong><\/h2>\n<p>phi.constr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n(0.0, mesh.facesLeft)<\/p>\n<p>phi.constrain(0.0, mesh.facesRight)<\/p>\n<h2><strong>\u521b\u5efa\u67e5\u770b\u5668<\/strong><\/h2>\n<p>viewer = Viewer(vars=phi, datamin=0.0, datamax=1.0)<\/p>\n<h2><strong>\u6c42\u89e3\u65b9\u7a0b<\/strong><\/h2>\n<p>timeStepDuration = 0.9 * dx2 \/ (2 * D)<\/p>\n<p>steps = 100<\/p>\n<p>for step in range(steps):<\/p>\n<p>    eq.solve(var=phi, dt=timeStepDuration)<\/p>\n<p>    viewer.plot()<\/p>\n<p>viewer.plot()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001Python\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316<\/h3>\n<\/p>\n<p><p>\u6570\u636e\u53ef\u89c6\u5316\u662f\u6570\u5b66\u8ba1\u7b97\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u901a\u8fc7\u56fe\u5f62\u548c\u56fe\u8868\u76f4\u89c2\u5730\u5c55\u793a\u8ba1\u7b97\u7ed3\u679c\uff0c\u4fbf\u4e8e\u5206\u6790\u548c\u7406\u89e3\u3002Matplotlib\u3001Seaborn\u3001Plotly\u7b49\u5e93\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6570\u636e\u53ef\u89c6\u5316\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><h4>1. Matplotlib<\/h4>\n<\/p>\n<p><p>Matplotlib\u662f\u6700\u57fa\u7840\u7684\u7ed8\u56fe\u5e93\uff0c\u9002\u7528\u4e8e\u5404\u79cd\u7c7b\u578b\u7684\u56fe\u5f62\u548c\u56fe\u8868\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u7ed8\u5236\u6563\u70b9\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u6570\u636e<\/strong><\/h2>\n<p>x = np.random.rand(100)<\/p>\n<p>y = np.random.rand(100)<\/p>\n<h2><strong>\u7ed8\u5236\u6563\u70b9\u56fe<\/strong><\/h2>\n<p>plt.scatter(x, y)<\/p>\n<p>plt.xlabel(&#39;x&#39;)<\/p>\n<p>plt.ylabel(&#39;y&#39;)<\/p>\n<p>plt.title(&#39;Scatter Plot&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. Seaborn<\/h4>\n<\/p>\n<p><p>Seaborn\u662f\u57fa\u4e8eMatplotlib\u7684\u9ad8\u7ea7\u7ed8\u56fe\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7b80\u6d01\u548c\u7f8e\u89c2\u7684\u7ed8\u56fe\u63a5\u53e3\uff0c\u9002\u7528\u4e8e\u7edf\u8ba1\u56fe\u8868\u7684\u7ed8\u5236\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u7ed8\u5236\u7bb1\u7ebf\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import seaborn as sns<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u751f\u6210\u6570\u636e<\/strong><\/h2>\n<p>data = np.random.normal(size=100)<\/p>\n<h2><strong>\u7ed8\u5236\u7bb1\u7ebf\u56fe<\/strong><\/h2>\n<p>sns.boxplot(data=data)<\/p>\n<p>plt.title(&#39;Box Plot&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. Plotly<\/h4>\n<\/p>\n<p><p>Plotly\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7ed8\u56fe\u5e93\uff0c\u9002\u7528\u4e8eWeb\u5e94\u7528\u548c\u4ea4\u4e92\u5f0f\u6570\u636e\u5206\u6790\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u7ed8\u5236\u4ea4\u4e92\u5f0f\u6298\u7ebf\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import plotly.graph_objects as go<\/p>\n<h2><strong>\u5b9a\u4e49\u6570\u636e<\/strong><\/h2>\n<p>x = [1, 2, 3, 4, 5]<\/p>\n<p>y = [10, 11, 12, 13, 14]<\/p>\n<h2><strong>\u521b\u5efa\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>fig = go.Figure(data=go.Scatter(x=x, y=y, mode=&#39;lines+markers&#39;))<\/p>\n<h2><strong>\u663e\u793a\u56fe\u8868<\/strong><\/h2>\n<p>fig.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001Python\u8fdb\u884c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u548c\u6df1\u5ea6\u5b66\u4e60<\/h3>\n<\/p>\n<p><p>\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u662f\u6570\u5b66\u8ba1\u7b97\u7684\u91cd\u8981\u5e94\u7528\u9886\u57df\uff0c\u6d89\u53ca\u5927\u91cf\u7684\u77e9\u9635\u8fd0\u7b97\u3001\u4f18\u5316\u7b97\u6cd5\u7b49\u3002Scikit-learn\u3001TensorFlow\u3001PyTorch\u7b49\u5e93\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><h4>1. Scikit-learn<\/h4>\n<\/p>\n<p><p>Scikit-learn\u662fPython\u7684\u673a\u5668\u5b66\u4e60\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\u548c\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528Scikit-learn\u8fdb\u884c\u7ebf\u6027\u56de\u5f52\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.linear_model import LinearRegression<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u5b9a\u4e49\u6570\u636e<\/strong><\/h2>\n<p>X = np.array([[1], [2], [3], [4], [5]])<\/p>\n<p>y = np.array([1, 3, 3, 2, 5])<\/p>\n<h2><strong>\u521b\u5efa\u6a21\u578b<\/strong><\/h2>\n<p>model = LinearRegression()<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>model.fit(X, y)<\/p>\n<h2><strong>\u9884\u6d4b<\/strong><\/h2>\n<p>predictions = model.predict(X)<\/p>\n<p>print(predictions)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. TensorFlow\u548cPyTorch<\/h4>\n<\/p>\n<p><p>TensorFlow\u548cPyTorch\u662f\u4e24\u4e2a\u4e3b\u6d41\u7684\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u795e\u7ecf\u7f51\u7edc\u8bad\u7ec3\u548c\u90e8\u7f72\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528TensorFlow\u6784\u5efa\u548c\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import tensorflow as tf<\/p>\n<p>from tensorflow.keras.models import Sequential<\/p>\n<p>from tensorflow.keras.layers import Dense<\/p>\n<h2><strong>\u521b\u5efa\u6a21\u578b<\/strong><\/h2>\n<p>model = Sequential([<\/p>\n<p>    Dense(10, input_shape=(1,), activation=&#39;relu&#39;),<\/p>\n<p>    Dense(1)<\/p>\n<p>])<\/p>\n<h2><strong>\u7f16\u8bd1\u6a21\u578b<\/strong><\/h2>\n<p>model.compile(optimizer=&#39;adam&#39;, loss=&#39;mean_squared_error&#39;)<\/p>\n<h2><strong>\u5b9a\u4e49\u6570\u636e<\/strong><\/h2>\n<p>X = np.array([[1], [2], [3], [4], [5]])<\/p>\n<p>y = np.array([1, 3, 3, 2, 5])<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>model.fit(X, y, epochs=100)<\/p>\n<h2><strong>\u9884\u6d4b<\/strong><\/h2>\n<p>predictions = model.predict(X)<\/p>\n<p>print(predictions)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u4f7f\u7528PyTorch\u6784\u5efa\u548c\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import torch<\/p>\n<p>import torch.nn as nn<\/p>\n<p>import torch.optim as optim<\/p>\n<h2><strong>\u5b9a\u4e49\u6570\u636e<\/strong><\/h2>\n<p>X = torch.tensor([[1], [2], [3], [4], [5]], dtype=torch.float32)<\/p>\n<p>y = torch.tensor([1, 3, 3, 2, 5], dtype=torch.float32).view(-1, 1)<\/p>\n<h2><strong>\u521b\u5efa\u6a21\u578b<\/strong><\/h2>\n<p>class SimpleNN(nn.Module):<\/p>\n<p>    def __init__(self):<\/p>\n<p>        super(SimpleNN, self).__init__()<\/p>\n<p>        self.fc1 = nn.Linear(1, 10)<\/p>\n<p>        self.fc2 = nn.Linear(10, 1)<\/p>\n<p>    def forward(self, x):<\/p>\n<p>        x = torch.relu(self.fc1(x))<\/p>\n<p>        x = self.fc2(x)<\/p>\n<p>        return x<\/p>\n<p>model = SimpleNN()<\/p>\n<h2><strong>\u5b9a\u4e49\u635f\u5931\u51fd\u6570\u548c\u4f18\u5316\u5668<\/strong><\/h2>\n<p>criterion = nn.MSELoss()<\/p>\n<p>optimizer = optim.Adam(model.parameters(), lr=0.01)<\/p>\n<h2><strong>\u8bad\u7ec3\u6a21\u578b<\/strong><\/h2>\n<p>for epoch in range(100):<\/p>\n<p>    model.train()<\/p>\n<p>    optimizer.zero_grad()<\/p>\n<p>    outputs = model(X)<\/p>\n<p>    loss = criterion(outputs, y)<\/p>\n<p>    loss.backward()<\/p>\n<p>    optimizer.step()<\/p>\n<h2><strong>\u9884\u6d4b<\/strong><\/h2>\n<p>model.eval()<\/p>\n<p>with torch.no_grad():<\/p>\n<p>    predictions = model(X)<\/p>\n<p>    print(predictions)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u7ed3\u8bba<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230Python\u5728\u6570\u5b66\u8ba1\u7b97\u65b9\u9762\u5177\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u548c\u5f3a\u5927\u7684\u529f\u80fd\u3002\u4ece\u57fa\u672c\u7684\u6570\u5b66\u8fd0\u7b97\u5230\u9ad8\u7ea7\u7684\u79d1\u5b66\u8ba1\u7b97\u3001\u6570\u503c\u6a21\u62df\u3001\u6570\u636e\u53ef\u89c6\u5316\u3001\u673a\u5668\u5b66\u4e60\u548c\u6df1\u5ea6\u5b66\u4e60\uff0cPython\u63d0\u4f9b\u4e86\u4e00\u6574\u5957\u4e30\u5bcc\u7684\u5de5\u5177\u548c\u5e93\uff0c\u6781\u5927\u5730\u63d0\u9ad8\u4e86\u6570\u5b66\u8ba1\u7b97\u7684\u6548\u7387\u548c\u4fbf\u6377\u6027\u3002\u65e0\u8bba\u662f\u5b66\u672f\u7814\u7a76\u3001\u5de5\u7a0b\u5e94\u7528\u8fd8\u662f\u6570\u636e\u5206\u6790\uff0cPython\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u5229\u5668\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u57fa\u672c\u7684\u6570\u5b66\u8fd0\u7b97\uff1f<\/strong><br \/>Python \u63d0\u4f9b\u4e86\u7b80\u5355\u6613\u7528\u7684\u8bed\u6cd5\uff0c\u53ef\u4ee5\u8fdb\u884c\u57fa\u672c\u7684\u6570\u5b66\u8fd0\u7b97\uff0c\u5982\u52a0\u3001\u51cf\u3001\u4e58\u3001\u9664\u3002\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u8fd0\u7b97\u7b26\uff0c\u4f8b\u5982 <code>+<\/code> \u8868\u793a\u52a0\u6cd5\uff0c<code>-<\/code> \u8868\u793a\u51cf\u6cd5\uff0c<code>*<\/code> \u8868\u793a\u4e58\u6cd5\uff0c\u4ee5\u53ca <code>\/<\/code> \u8868\u793a\u9664\u6cd5\u3002\u6bd4\u5982\uff0c\u8f93\u5165 <code>result = 5 + 3<\/code> \u5c06\u8ba1\u7b97 5 \u548c 3 \u7684\u548c\uff0c\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728\u53d8\u91cf <code>result<\/code> \u4e2d\u3002Python \u8fd8\u652f\u6301\u6d6e\u70b9\u6570\u8fd0\u7b97\u548c\u62ec\u53f7\u4f18\u5148\u7ea7\uff0c\u901a\u8fc7\u5408\u7406\u4f7f\u7528\u8fd9\u4e9b\u529f\u80fd\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5b8c\u6210\u5404\u79cd\u6570\u5b66\u8ba1\u7b97\u3002<\/p>\n<p><strong>Python\u662f\u5426\u652f\u6301\u66f4\u590d\u6742\u7684\u6570\u5b66\u529f\u80fd\uff1f<\/strong><br \/>\u5f53\u7136\uff0cPython \u7684\u529f\u80fd\u8fdc\u4e0d\u6b62\u4e8e\u57fa\u672c\u8fd0\u7b97\u3002\u501f\u52a9\u4e8e\u6570\u5b66\u5e93\uff0c\u4f8b\u5982 <code>math<\/code> \u548c <code>numpy<\/code>\uff0c\u7528\u6237\u53ef\u4ee5\u8fdb\u884c\u66f4\u590d\u6742\u7684\u8ba1\u7b97\uff0c\u5982\u4e09\u89d2\u51fd\u6570\u3001\u5bf9\u6570\u3001\u6570\u7ec4\u8fd0\u7b97\u7b49\u3002\u4f8b\u5982\uff0c\u4f7f\u7528 <code>import math<\/code> \u53ef\u4ee5\u8c03\u7528 <code>math.sqrt(16)<\/code> \u6765\u8ba1\u7b97 16 \u7684\u5e73\u65b9\u6839\u3002\u6b64\u5916\uff0c<code>numpy<\/code> \u5e93\u4f7f\u5f97\u5904\u7406\u5927\u578b\u6570\u636e\u96c6\u548c\u77e9\u9635\u8fd0\u7b97\u53d8\u5f97\u66f4\u52a0\u9ad8\u6548\uff0c\u9002\u5408\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u5904\u7406\u6570\u5b66\u8868\u8fbe\u5f0f\uff1f<\/strong><br \/>\u5904\u7406\u6570\u5b66\u8868\u8fbe\u5f0f\u53ef\u4ee5\u4f7f\u7528 <code>eval()<\/code> \u51fd\u6570\uff0c\u8be5\u51fd\u6570\u80fd\u591f\u5c06\u5b57\u7b26\u4e32\u5f62\u5f0f\u7684\u8868\u8fbe\u5f0f\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u7684\u4ee3\u7801\u3002\u4f8b\u5982\uff0c<code>eval(&quot;3 + 4 * 2&quot;)<\/code> \u5c06\u8fd4\u56de 11\u3002\u5c3d\u7ba1 <code>eval()<\/code> \u5f88\u5f3a\u5927\uff0c\u4f46\u5728\u4f7f\u7528\u65f6\u9700\u8c28\u614e\uff0c\u907f\u514d\u6267\u884c\u4e0d\u53ef\u4fe1\u7684\u8f93\u5165\u3002\u5bf9\u4e8e\u590d\u6742\u7684\u8868\u8fbe\u5f0f\u89e3\u6790\uff0c\u63a8\u8350\u4f7f\u7528 <code>sympy<\/code> \u5e93\uff0c\u5b83\u53ef\u4ee5\u8f7b\u677e\u5904\u7406\u7b26\u53f7\u8fd0\u7b97\u548c\u65b9\u7a0b\u6c42\u89e3\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u66f4\u5b89\u5168\u548c\u7075\u6d3b\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u8fdb\u884c\u6570\u5b66\u8ba1\u7b97\u7684\u6838\u5fc3\u8981\u70b9\u662f\uff1aPython\u5177\u6709\u4e30\u5bcc\u7684\u6570\u5b66\u5e93\u3001\u7075\u6d3b\u7684\u8bed\u6cd5\u3001\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u5de5\u5177\u3001\u826f\u597d\u7684 [&hellip;]","protected":false},"author":3,"featured_media":1121696,"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\/1121688"}],"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=1121688"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1121688\/revisions"}],"predecessor-version":[{"id":1121698,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1121688\/revisions\/1121698"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1121696"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1121688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1121688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1121688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}