{"id":1002920,"date":"2024-12-27T10:12:52","date_gmt":"2024-12-27T02:12:52","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1002920.html"},"modified":"2024-12-27T10:12:54","modified_gmt":"2024-12-27T02:12:54","slug":"%e5%a6%82%e4%bd%95%e6%90%ad%e5%bb%bapython%e7%bb%98%e5%9b%be%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1002920.html","title":{"rendered":"\u5982\u4f55\u642d\u5efapython\u7ed8\u56fe\u73af\u5883"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25080457\/00d82fdb-46b9-40ef-9ad9-85fa7d98b865.webp\" alt=\"\u5982\u4f55\u642d\u5efapython\u7ed8\u56fe\u73af\u5883\" \/><\/p>\n<p><p> \u642d\u5efaPython\u7ed8\u56fe\u73af\u5883\u7684\u5173\u952e\u6b65\u9aa4\u5305\u62ec\uff1a<strong>\u9009\u62e9\u5408\u9002\u7684Python\u53d1\u884c\u7248\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u7ed8\u56fe\u5e93\u3001\u914d\u7f6e\u865a\u62df\u73af\u5883\u3001\u9009\u62e9\u548c\u8bbe\u7f6eIDE<\/strong>\u3002\u9009\u62e9\u5408\u9002\u7684Python\u53d1\u884c\u7248\u662f\u642d\u5efa\u7ed8\u56fe\u73af\u5883\u7684\u57fa\u7840\uff0c\u63a8\u8350\u4f7f\u7528Anaconda\uff0c\u56e0\u4e3a\u5b83\u81ea\u5e26\u8bb8\u591a\u79d1\u5b66\u8ba1\u7b97\u548c\u7ed8\u56fe\u5e93\u3002\u5b89\u88c5\u5fc5\u8981\u7684\u7ed8\u56fe\u5e93\u5982Matplotlib\u3001Seaborn\u3001Plotly\u7b49\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u6216conda\u547d\u4ee4\u8fdb\u884c\u3002\u914d\u7f6e\u865a\u62df\u73af\u5883\u53ef\u4ee5\u907f\u514d\u5305\u7ba1\u7406\u51b2\u7a81\uff0c\u4fdd\u6301\u9879\u76ee\u7684\u72ec\u7acb\u6027\u3002\u6700\u540e\uff0c\u9009\u62e9\u548c\u8bbe\u7f6e\u4e00\u4e2a\u5408\u9002\u7684IDE\uff0c\u5982PyCharm\u6216Jupyter Notebook\uff0c\u53ef\u4ee5\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002\u5728\u8be6\u7ec6\u63cf\u8ff0\u4e2d\uff0c\u6211\u4eec\u5c06\u91cd\u70b9\u63a2\u8ba8\u5982\u4f55\u9009\u62e9\u548c\u914d\u7f6eIDE\u3002<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u548c\u914d\u7f6e\u4e00\u4e2a\u5408\u9002\u7684IDE\u5bf9\u4e8ePython\u7ed8\u56fe\u73af\u5883\u7684\u642d\u5efa\u81f3\u5173\u91cd\u8981\u3002<strong>IDE\u4e0d\u4ec5\u4ec5\u662f\u4e00\u4e2a\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5b83\u63d0\u4f9b\u4e86\u8c03\u8bd5\u3001\u6267\u884c\u3001\u7248\u672c\u63a7\u5236\u7b49\u529f\u80fd<\/strong>\u3002\u5bf9\u4e8e\u6570\u636e\u53ef\u89c6\u5316\u5de5\u4f5c\uff0cJupyter Notebook\u662f\u975e\u5e38\u53d7\u6b22\u8fce\u7684\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u652f\u6301\u4ea4\u4e92\u5f0f\u7f16\u7a0b\uff0c\u5141\u8bb8\u7528\u6237\u5728\u4e00\u4e2a\u53ef\u89c6\u5316\u5355\u5143\u4e2d\u7f16\u5199\u4ee3\u7801\u3001\u6267\u884c\u4ee3\u7801\u5e76\u7acb\u5373\u67e5\u770b\u7ed3\u679c\u3002\u8fd9\u79cd\u7279\u6027\u4f7f\u5f97Jupyter Notebook\u7279\u522b\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u7ed8\u56fe\u5de5\u4f5c\u3002\u901a\u8fc7\u5728Notebook\u4e2d\u9010\u6b65\u6267\u884c\u4ee3\u7801\uff0c\u7528\u6237\u53ef\u4ee5\u5b9e\u65f6\u8c03\u6574\u53c2\u6570\uff0c\u5e76\u7acb\u5373\u770b\u5230\u56fe\u5f62\u7684\u53d8\u5316\uff0c\u8fd9\u5927\u5927\u63d0\u9ad8\u4e86\u8c03\u8bd5\u548c\u5f00\u53d1\u7684\u6548\u7387\u3002\u6b64\u5916\uff0cJupyter Notebook\u652f\u6301Markdown\u683c\u5f0f\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u4ee3\u7801\u5355\u5143\u4e4b\u95f4\u6dfb\u52a0\u8bf4\u660e\u6587\u5b57\uff0c\u4f7f\u5f97\u6574\u4e2a\u5206\u6790\u8fc7\u7a0b\u66f4\u52a0\u6e05\u6670\u6613\u61c2\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u9009\u62e9\u5408\u9002\u7684Python\u53d1\u884c\u7248<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684Python\u53d1\u884c\u7248\u662f\u642d\u5efa\u7ed8\u56fe\u73af\u5883\u7684\u7b2c\u4e00\u6b65\u3002\u5e02\u573a\u4e0a\u6709\u591a\u79cdPython\u53d1\u884c\u7248\u53ef\u4f9b\u9009\u62e9\uff0c\u6700\u5e38\u7528\u7684\u6709\u5b98\u65b9Python\u3001Anaconda\u548cMiniconda\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u5b98\u65b9Python\u53d1\u884c\u7248<\/p>\n<p>\u5b98\u65b9Python\u53d1\u884c\u7248\u662f\u7531Python Software Foundation\u63d0\u4f9b\u7684\u6807\u51c6\u7248\u672c\u3002\u5b83\u9002\u7528\u4e8e\u6240\u6709\u7528\u6237\uff0c\u7279\u522b\u662f\u90a3\u4e9b\u5e0c\u671b\u8f7b\u91cf\u7ea7\u5b89\u88c5\u7684\u7528\u6237\u3002\u7528\u6237\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u9002\u7528\u4e8e\u5176\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u3002\u7136\u800c\uff0c\u5b98\u65b9Python\u53d1\u884c\u7248\u4e0d\u5305\u542b\u8bb8\u591a\u79d1\u5b66\u8ba1\u7b97\u548c\u7ed8\u56fe\u5e93\uff0c\u9700\u8981\u7528\u6237\u624b\u52a8\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>Anaconda<\/p>\n<p>Anaconda\u662f\u4e00\u4e2a\u9762\u5411\u79d1\u5b66\u8ba1\u7b97\u7684Python\u53d1\u884c\u7248\uff0c\u5b83\u96c6\u6210\u4e86\u5927\u91cf\u7684\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u5e93\uff0c\u5982NumPy\u3001Pandas\u3001Matplotlib\u3001Scikit-learn\u7b49\u3002Anaconda\u8fd8\u81ea\u5e26Conda\u5305\u7ba1\u7406\u5668\uff0c\u65b9\u4fbf\u7528\u6237\u7ba1\u7406Python\u5305\u548c\u73af\u5883\u3002\u5bf9\u4e8e\u9700\u8981\u5feb\u901f\u642d\u5efa\u6570\u636e\u79d1\u5b66\u73af\u5883\u7684\u7528\u6237\uff0cAnaconda\u662f\u4e00\u4e2a\u6781\u4f73\u7684\u9009\u62e9\u3002\u7528\u6237\u53ef\u4ee5\u4eceAnaconda\u5b98\u7f51\u514d\u8d39\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>Miniconda<\/p>\n<p>Miniconda\u662fAnaconda\u7684\u4e00\u4e2a\u7cbe\u7b80\u7248\u672c\uff0c\u53ea\u5305\u542bConda\u5305\u7ba1\u7406\u5668\u548cPython\u3002\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5b89\u88c5\u5176\u4ed6\u5305\u3002Miniconda\u9002\u7528\u4e8e\u90a3\u4e9b\u5e0c\u671b\u5728\u7cbe\u7b80\u5b89\u88c5\u57fa\u7840\u4e0a\u6309\u9700\u6dfb\u52a0\u7ec4\u4ef6\u7684\u7528\u6237\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u7ed8\u56fe\u5e93<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u7ed8\u56fe\u5e93\u662f\u642d\u5efaPython\u7ed8\u56fe\u73af\u5883\u7684\u6838\u5fc3\u6b65\u9aa4\u4e4b\u4e00\u3002Python\u4e2d\u6709\u591a\u79cd\u5f3a\u5927\u7684\u7ed8\u56fe\u5e93\u53ef\u4f9b\u9009\u62e9\uff0c\u4e0b\u9762\u4ecb\u7ecd\u51e0\u79cd\u5e38\u7528\u7684\u7ed8\u56fe\u5e93\u53ca\u5176\u5b89\u88c5\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<ol>\n<li>Matplotlib<\/p>\n<p>Matplotlib\u662fPython\u6700\u57fa\u7840\u7684\u7ed8\u56fe\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u751f\u4ea7\u8d28\u91cf\u76842D\u7ed8\u56fe\u80fd\u529b\u3002Matplotlib\u7684\u5b89\u88c5\u53ef\u4ee5\u901a\u8fc7pip\u6216conda\u5b8c\u6210\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install matplotlib<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>Seaborn<\/p>\n<p>Seaborn\u57fa\u4e8eMatplotlib\uff0c\u63d0\u4f9b\u66f4\u9ad8\u7ea7\u7684\u63a5\u53e3\u548c\u66f4\u7f8e\u89c2\u7684\u9ed8\u8ba4\u4e3b\u9898\uff0c\u9002\u7528\u4e8e\u7edf\u8ba1\u6570\u636e\u7684\u53ef\u89c6\u5316\u3002\u5b89\u88c5Seaborn\u4e5f\u53ef\u4ee5\u4f7f\u7528pip\u6216conda\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install seaborn<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install seaborn<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>Plotly<\/p>\n<p>Plotly\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7ed8\u56fe\u5e93\uff0c\u652f\u6301\u591a\u79cd\u56fe\u8868\u7c7b\u578b\uff0c\u7279\u522b\u9002\u5408\u4e8e\u521b\u5efa\u52a8\u6001\u7f51\u9875\u53ef\u89c6\u5316\u3002Plotly\u7684\u5b89\u88c5\u65b9\u6cd5\u5982\u4e0b\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install plotly<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install -c plotly plotly<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li>Bokeh<\/p>\n<p>Bokeh\u4e13\u6ce8\u4e8e\u5927\u89c4\u6a21\u6570\u636e\u96c6\u7684\u4ea4\u4e92\u5f0f\u53ef\u89c6\u5316\u3002\u5b83\u5141\u8bb8\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u521b\u5efa\u590d\u6742\u7684\u56fe\u5f62\u3002\u5b89\u88c5Bokeh\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b8c\u6210\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install bokeh<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install bokeh<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u914d\u7f6e\u865a\u62df\u73af\u5883<\/p>\n<\/p>\n<p><p>\u914d\u7f6e\u865a\u62df\u73af\u5883\u662f\u7ba1\u7406Python\u5305\u548c\u9879\u76ee\u4f9d\u8d56\u7684\u91cd\u8981\u6b65\u9aa4\u3002\u865a\u62df\u73af\u5883\u4f7f\u5f97\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u5305\u548c\u7248\u672c\u4e92\u4e0d\u5e72\u6270\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528venv\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883<\/p>\n<p>Python\u7684\u6807\u51c6\u5e93\u4e2d\u63d0\u4f9b\u4e86venv\u6a21\u5757\uff0c\u7528\u4e8e\u521b\u5efa\u865a\u62df\u73af\u5883\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">python -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\uff0cmyenv\u662f\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/p>\n<p>\u521b\u5efa\u865a\u62df\u73af\u5883\u540e\uff0c\u9700\u8981\u6fc0\u6d3b\u5b83\u4ee5\u4fbf\u5728\u8be5\u73af\u5883\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u5305\u3002\u5728Windows\u4e0a\uff0c\u6fc0\u6d3b\u547d\u4ee4\u4e3a\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Linux\u548cmacOS\u4e0a\uff0c\u6fc0\u6d3b\u547d\u4ee4\u4e3a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u4f7f\u7528Conda\u521b\u5efa\u865a\u62df\u73af\u5883<\/p>\n<p>\u5982\u679c\u4f7f\u7528Anaconda\u6216Miniconda\uff0c\u53ef\u4ee5\u901a\u8fc7Conda\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-bash\">conda create --name myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6fc0\u6d3bConda\u865a\u62df\u73af\u5883\u7684\u547d\u4ee4\u4e3a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda activate myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u9009\u62e9\u548c\u8bbe\u7f6eIDE<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u548c\u8bbe\u7f6e\u4e00\u4e2a\u5408\u9002\u7684IDE\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u7f16\u7a0b\u6548\u7387\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u5e38\u7528\u7684IDE\u53ca\u5176\u7279\u70b9\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p>PyCharm<\/p>\n<p>PyCharm\u662fJetBr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns\u516c\u53f8\u5f00\u53d1\u7684Python\u4e13\u7528IDE\uff0c\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u4ee3\u7801\u7f16\u8f91\u3001\u8c03\u8bd5\u3001\u6d4b\u8bd5\u548c\u7248\u672c\u63a7\u5236\u529f\u80fd\u3002PyCharm\u5206\u4e3a\u793e\u533a\u7248\u548c\u4e13\u4e1a\u7248\uff0c\u793e\u533a\u7248\u514d\u8d39\u3002\u7528\u6237\u53ef\u4ee5\u4ecePyCharm\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>Jupyter Notebook<\/p>\n<p>Jupyter Notebook\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0fPython\u5f00\u53d1\u73af\u5883\uff0c\u7279\u522b\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u3002\u5b83\u5141\u8bb8\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u7f16\u5199\u548c\u6267\u884c\u4ee3\u7801\uff0c\u5e76\u76f4\u63a5\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002Jupyter Notebook\u53ef\u4ee5\u901a\u8fc7pip\u6216conda\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>Visual Studio Code<\/p>\n<p>Visual Studio Code\u662f\u5fae\u8f6f\u63a8\u51fa\u7684\u8f7b\u91cf\u7ea7\u3001\u8de8\u5e73\u53f0\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u652f\u6301Python\u7f16\u7a0b\u3002\u901a\u8fc7\u5b89\u88c5Python\u6269\u5c55\uff0cVS Code\u53ef\u4ee5\u63d0\u4f9b\u667a\u80fd\u4ee3\u7801\u8865\u5168\u3001\u8c03\u8bd5\u7b49\u529f\u80fd\u3002\u7528\u6237\u53ef\u4ee5\u4eceVS Code\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<\/p>\n<\/ol>\n<p><p>\u4e94\u3001\u914d\u7f6e\u548c\u6d4b\u8bd5\u7ed8\u56fe\u73af\u5883<\/p>\n<\/p>\n<p><p>\u642d\u5efa\u597d\u7ed8\u56fe\u73af\u5883\u540e\uff0c\u9700\u8981\u8fdb\u884c\u914d\u7f6e\u548c\u6d4b\u8bd5\u4ee5\u786e\u4fdd\u5176\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6d4b\u8bd5Python\u5b89\u88c5<\/p>\n<p>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165<code>python --version<\/code>\uff0c\u68c0\u67e5Python\u662f\u5426\u5b89\u88c5\u6b63\u786e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u6d4b\u8bd5\u7ed8\u56fe\u5e93<\/p>\n<p>\u5728\u6fc0\u6d3b\u7684\u865a\u62df\u73af\u5883\u4e2d\uff0c\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\uff0c\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u6d4b\u8bd5\u7ed8\u56fe\u5e93\uff1a<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>plt.plot([1, 2, 3], [4, 5, 6])<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u770b\u5230\u7ed8\u56fe\u7a97\u53e3\u5f39\u51fa\uff0c\u8bf4\u660eMatplotlib\u5b89\u88c5\u6b63\u786e\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u6d4b\u8bd5Jupyter Notebook<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\uff0c\u8f93\u5165<code>jupyter notebook<\/code>\u542f\u52a8Jupyter Notebook\u670d\u52a1\u3002\u6d4f\u89c8\u5668\u4e2d\u4f1a\u6253\u5f00Jupyter Notebook\u754c\u9762\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7b14\u8bb0\u672c\uff0c\u8f93\u5165\u5e76\u8fd0\u884c\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/li>\n<\/p>\n<\/ol>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>plt.plot([1, 2, 3], [4, 5, 6])<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u56fe\u5f62\u6b63\u5e38\u663e\u793a\uff0c\u8bf4\u660eJupyter Notebook\u914d\u7f6e\u6b63\u786e\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u6210\u529f\u642d\u5efa\u4e00\u4e2aPython\u7ed8\u56fe\u73af\u5883\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u5de5\u4f5c\u3002\u6ce8\u610f\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u6839\u636e\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u7ed8\u56fe\u5e93\u548c\u5de5\u5177\uff0c\u4ee5\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684IDE\u6216\u6587\u672c\u7f16\u8f91\u5668\u8fdb\u884cPython\u7ed8\u56fe\uff1f<\/strong><br \/>\u5728\u642d\u5efaPython\u7ed8\u56fe\u73af\u5883\u65f6\uff0c\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684IDE\uff08\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff09\u6216\u6587\u672c\u7f16\u8f91\u5668\u81f3\u5173\u91cd\u8981\u3002\u5e38\u7528\u7684IDE\u5305\u62ecPyCharm\u3001Jupyter Notebook\u548cVisual Studio Code\u3002Jupyter Notebook\u7279\u522b\u9002\u5408\u6570\u636e\u53ef\u89c6\u5316\uff0c\u56e0\u4e3a\u5b83\u652f\u6301\u4ee3\u7801\u548c\u7ed3\u679c\u7684\u4ea4\u4e92\u5c55\u793a\u3002\u800cPyCharm\u5219\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8c03\u8bd5\u529f\u80fd\uff0c\u9002\u5408\u5927\u578b\u9879\u76ee\u5f00\u53d1\u3002Visual Studio Code\u5219\u4ee5\u5176\u8f7b\u91cf\u548c\u63d2\u4ef6\u652f\u6301\u8457\u79f0\uff0c\u9002\u5408\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u7684\u5f00\u53d1\u3002<\/p>\n<p><strong>Python\u7ed8\u56fe\u5e93\u6709\u54ea\u4e9b\u63a8\u8350\uff0c\u5982\u4f55\u9009\u62e9\uff1f<\/strong><br \/>Python\u62e5\u6709\u4f17\u591a\u7ed8\u56fe\u5e93\uff0c\u6bcf\u4e2a\u5e93\u90fd\u9002\u7528\u4e8e\u4e0d\u540c\u7c7b\u578b\u7684\u7ed8\u56fe\u9700\u6c42\u3002Matplotlib\u662f\u6700\u5e38\u7528\u7684\u5e93\uff0c\u9002\u5408\u57fa\u7840\u7ed8\u56fe\u548c\u6570\u636e\u53ef\u89c6\u5316\uff1bSeaborn\u5728Matplotlib\u7684\u57fa\u7840\u4e0a\uff0c\u63d0\u4f9b\u66f4\u7f8e\u89c2\u7684\u7edf\u8ba1\u56fe\u5f62\uff1bPlotly\u652f\u6301\u4ea4\u4e92\u5f0f\u7ed8\u56fe\uff0c\u9002\u5408\u9700\u8981\u52a8\u6001\u5c55\u793a\u7684\u5e94\u7528\u573a\u666f\u3002\u6839\u636e\u5177\u4f53\u7684\u9700\u6c42\uff0c\u53ef\u4ee5\u9009\u62e9\u5408\u9002\u7684\u5e93\u6765\u5b9e\u73b0\u76ee\u6807\uff0c\u4f8b\u5982\u5982\u679c\u9700\u8981\u751f\u6210\u590d\u6742\u7684\u56fe\u8868\uff0cPlotly\u53ef\u80fd\u662f\u6700\u4f73\u9009\u62e9\u3002<\/p>\n<p><strong>\u5728\u642d\u5efaPython\u7ed8\u56fe\u73af\u5883\u65f6\uff0c\u5982\u4f55\u5904\u7406\u4f9d\u8d56\u5305\u7684\u5b89\u88c5\uff1f<\/strong><br \/>\u5b89\u88c5Python\u7ed8\u56fe\u73af\u5883\u65f6\uff0c\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5982pip\u6216conda\u80fd\u591f\u7b80\u5316\u4f9d\u8d56\u5305\u7684\u5b89\u88c5\u8fc7\u7a0b\u3002\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\u53ef\u4ee5\u907f\u514d\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u51b2\u7a81\u3002\u901a\u8fc7\u547d\u4ee4\u884c\u8f93\u5165\u201cpip install matplotlib seaborn\u201d\u6765\u5b89\u88c5\u5e38\u7528\u7684\u7ed8\u56fe\u5e93\u3002\u5bf9\u4e8e\u9700\u8981\u66f4\u590d\u6742\u7684\u4f9d\u8d56\u7ba1\u7406\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528Anaconda\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7528\u6237\u53cb\u597d\u7684\u754c\u9762\u6765\u7ba1\u7406\u5305\u548c\u73af\u5883\uff0c\u4f7f\u5f97\u5b89\u88c5\u548c\u66f4\u65b0\u53d8\u5f97\u66f4\u52a0\u4fbf\u6377\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u642d\u5efaPython\u7ed8\u56fe\u73af\u5883\u7684\u5173\u952e\u6b65\u9aa4\u5305\u62ec\uff1a\u9009\u62e9\u5408\u9002\u7684Python\u53d1\u884c\u7248\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u7ed8\u56fe\u5e93\u3001\u914d\u7f6e\u865a\u62df\u73af\u5883\u3001\u9009\u62e9\u548c\u8bbe [&hellip;]","protected":false},"author":3,"featured_media":1002924,"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\/1002920"}],"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=1002920"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1002920\/revisions"}],"predecessor-version":[{"id":1002926,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1002920\/revisions\/1002926"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1002924"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1002920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1002920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1002920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}