{"id":1020560,"date":"2024-12-27T13:13:14","date_gmt":"2024-12-27T05:13:14","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1020560.html"},"modified":"2024-12-27T13:13:16","modified_gmt":"2024-12-27T05:13:16","slug":"python%e5%a6%82%e4%bd%95%e7%bb%98%e5%88%b6%e9%99%8d%e6%b0%b4%e5%9b%be","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1020560.html","title":{"rendered":"Python\u5982\u4f55\u7ed8\u5236\u964d\u6c34\u56fe"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25162945\/9ae932dc-bbf1-4be2-84ec-b598b55ab666.webp\" alt=\"Python\u5982\u4f55\u7ed8\u5236\u964d\u6c34\u56fe\" \/><\/p>\n<p><p> \u8981\u5728Python\u4e2d\u7ed8\u5236\u964d\u6c34\u56fe\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u4e00\u4e9b\u6570\u636e\u53ef\u89c6\u5316\u5e93\u3002<strong>\u4e3b\u8981\u5de5\u5177\u5305\u62ecMatplotlib\u3001Seaborn\u3001Plotly\u548cPandas<\/strong>\u3002\u5176\u4e2dMatplotlib\u662f\u6700\u4e3a\u57fa\u7840\u548c\u5e38\u7528\u7684\u5de5\u5177\uff0c\u800cSeaborn\u548cPlotly\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u7684\u7ed8\u56fe\u529f\u80fd\u3002\u5177\u4f53\u6b65\u9aa4\u901a\u5e38\u5305\u62ec\uff1a\u51c6\u5907\u6570\u636e\u3001\u9009\u62e9\u5408\u9002\u7684\u56fe\u8868\u7c7b\u578b\u3001\u4f7f\u7528\u5e93\u51fd\u6570\u8fdb\u884c\u7ed8\u5236\u3001\u8c03\u6574\u56fe\u8868\u6837\u5f0f\u548c\u7ec6\u8282\u3002<\/p>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u8be6\u7ec6\u63a2\u8ba8\u5982\u4f55\u4f7f\u7528Matplotlib\u6765\u7ed8\u5236\u964d\u6c34\u56fe\u3002\u9996\u5148\uff0c\u9700\u8981\u6709\u4e00\u7ec4\u964d\u6c34\u6570\u636e\uff0c\u901a\u5e38\u4ee5CSV\u6587\u4ef6\u6216\u6570\u636e\u5e93\u7684\u5f62\u5f0f\u5b58\u50a8\u3002\u7136\u540e\uff0c\u4f7f\u7528Pandas\u8bfb\u53d6\u6570\u636e\u5e76\u8fdb\u884c\u9884\u5904\u7406\u3002\u63a5\u4e0b\u6765\uff0c\u5229\u7528Matplotlib\u7684\u57fa\u672c\u51fd\u6570\u521b\u5efa\u56fe\u8868\u3002\u6700\u540e\uff0c\u901a\u8fc7\u8c03\u6574\u56fe\u8868\u7684\u6837\u5f0f\u548c\u7ec6\u8282\uff0c\u4f7f\u5176\u66f4\u5177\u53ef\u8bfb\u6027\u548c\u7f8e\u89c2\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u6570\u636e\u51c6\u5907\u4e0e\u8bfb\u53d6<\/p>\n<\/p>\n<p><p>\u5728\u7ed8\u5236\u964d\u6c34\u56fe\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u51c6\u5907\u597d\u964d\u6c34\u6570\u636e\u3002\u6570\u636e\u901a\u5e38\u5305\u62ec\u65e5\u671f\u548c\u964d\u6c34\u91cf\u4e24\u5217\uff0c\u53ef\u80fd\u8fd8\u4f1a\u5305\u62ec\u5730\u70b9\u3001\u6e29\u5ea6\u7b49\u5176\u4ed6\u76f8\u5173\u4fe1\u606f\u3002\u6570\u636e\u53ef\u4ee5\u6765\u81ea\u591a\u79cd\u6765\u6e90\uff0c\u5982\u6c14\u8c61\u90e8\u95e8\u7684\u6570\u636e\u96c6\u3001\u7f51\u7edc\u516c\u5f00\u6570\u636e\u3001\u6216\u8005\u81ea\u5b9a\u4e49\u7684\u6570\u636e\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0cPandas\u5e93\u662f\u5904\u7406\u6570\u636e\u7684\u5f3a\u5927\u5de5\u5177\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Pandas\u8bfb\u53d6CSV\u6587\u4ef6\u6216\u4ece\u6570\u636e\u5e93\u4e2d\u63d0\u53d6\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u5c55\u793a\u5982\u4f55\u4f7f\u7528Pandas\u8bfb\u53d6CSV\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6\u964d\u6c34\u6570\u636e<\/strong><\/h2>\n<p>data = pd.read_csv(&#39;precipitation_data.csv&#39;)<\/p>\n<h2><strong>\u67e5\u770b\u6570\u636e\u7ed3\u6784<\/strong><\/h2>\n<p>print(data.head())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u6bb5\u4ee3\u7801\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e\u5bfc\u5165\u5230Python\u4e2d\uff0c\u5e76\u4f7f\u7528Pandas\u7684\u529f\u80fd\u8fdb\u884c\u8fdb\u4e00\u6b65\u5206\u6790\u548c\u5904\u7406\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u9009\u62e9\u5408\u9002\u7684\u56fe\u8868\u7c7b\u578b<\/p>\n<\/p>\n<p><p>\u5728\u7ed8\u5236\u964d\u6c34\u6570\u636e\u65f6\uff0c\u9009\u62e9\u5408\u9002\u7684\u56fe\u8868\u7c7b\u578b\u81f3\u5173\u91cd\u8981\u3002<strong>\u5e38\u7528\u7684\u56fe\u8868\u7c7b\u578b\u5305\u62ec\u6298\u7ebf\u56fe\u3001\u67f1\u72b6\u56fe\u548c\u6563\u70b9\u56fe<\/strong>\u3002\u6298\u7ebf\u56fe\u9002\u5408\u5c55\u793a\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u7684\u53d8\u5316\u8d8b\u52bf\uff0c\u800c\u67f1\u72b6\u56fe\u5219\u53ef\u4ee5\u66f4\u76f4\u89c2\u5730\u6bd4\u8f83\u4e0d\u540c\u65f6\u95f4\u6bb5\u7684\u964d\u6c34\u91cf\u3002<\/p>\n<\/p>\n<ol>\n<li>\u6298\u7ebf\u56fe\uff1a\u6298\u7ebf\u56fe\u7528\u4e8e\u5c55\u793a\u968f\u65f6\u95f4\u53d8\u5316\u7684\u8d8b\u52bf\u3002\u5bf9\u4e8e\u964d\u6c34\u6570\u636e\uff0c\u6298\u7ebf\u56fe\u53ef\u4ee5\u6e05\u6670\u5730\u5c55\u793a\u964d\u6c34\u91cf\u7684\u53d8\u5316\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u7ed8\u5236\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(data[&#39;date&#39;], data[&#39;precipitation&#39;])<\/p>\n<p>plt.title(&#39;Precipitation Over Time&#39;)<\/p>\n<p>plt.xlabel(&#39;Date&#39;)<\/p>\n<p>plt.ylabel(&#39;Precipitation (mm)&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u67f1\u72b6\u56fe\uff1a\u67f1\u72b6\u56fe\u9002\u5408\u7528\u4e8e\u6bd4\u8f83\u4e0d\u540c\u65f6\u95f4\u6bb5\u6216\u5730\u70b9\u7684\u964d\u6c34\u91cf\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\"># \u7ed8\u5236\u67f1\u72b6\u56fe<\/p>\n<p>plt.bar(data[&#39;date&#39;], data[&#39;precipitation&#39;])<\/p>\n<p>plt.title(&#39;Precipitation Over Time&#39;)<\/p>\n<p>plt.xlabel(&#39;Date&#39;)<\/p>\n<p>plt.ylabel(&#39;Precipitation (mm)&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u6570\u636e\u9884\u5904\u7406\u4e0e\u6e05\u6d17<\/p>\n<\/p>\n<p><p>\u5728\u7ed8\u5236\u4e4b\u524d\uff0c\u6570\u636e\u7684\u9884\u5904\u7406\u548c\u6e05\u6d17\u662f\u975e\u5e38\u91cd\u8981\u7684\u4e00\u6b65\u3002<strong>\u6570\u636e\u9884\u5904\u7406\u6b65\u9aa4\u5305\u62ec\u7f3a\u5931\u503c\u5904\u7406\u3001\u6570\u636e\u683c\u5f0f\u8f6c\u6362\u548c\u5f02\u5e38\u503c\u68c0\u6d4b<\/strong>\u3002\u5bf9\u4e8e\u964d\u6c34\u6570\u636e\uff0c\u7f3a\u5931\u503c\u53ef\u80fd\u5f71\u54cd\u5206\u6790\u7ed3\u679c\uff0c\u56e0\u6b64\u9700\u8981\u59a5\u5584\u5904\u7406\u3002<\/p>\n<\/p>\n<ol>\n<li>\u7f3a\u5931\u503c\u5904\u7406\uff1a\u5982\u679c\u6570\u636e\u4e2d\u5b58\u5728\u7f3a\u5931\u503c\uff0c\u53ef\u4ee5\u9009\u62e9\u5220\u9664\u6216\u586b\u5145\u7f3a\u5931\u503c\u3002Pandas\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u7f3a\u5931\u503c\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\"># \u5220\u9664\u7f3a\u5931\u503c<\/p>\n<p>data = data.dropna()<\/p>\n<h2><strong>\u6216\u8005\u586b\u5145\u7f3a\u5931\u503c<\/strong><\/h2>\n<p>data = data.fillna(method=&#39;ffill&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u5f02\u5e38\u503c\u68c0\u6d4b\uff1a\u5f02\u5e38\u503c\u53ef\u80fd\u662f\u7531\u4e8e\u6570\u636e\u8f93\u5165\u9519\u8bef\u6216\u6781\u7aef\u5929\u6c14\u9020\u6210\u7684\u3002\u53ef\u4ee5\u4f7f\u7528\u7edf\u8ba1\u65b9\u6cd5\u68c0\u6d4b\u5e76\u5904\u7406\u8fd9\u4e9b\u5f02\u5e38\u503c\u3002<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528z-score\u68c0\u6d4b\u5f02\u5e38\u503c<\/p>\n<p>from scipy.stats import zscore<\/p>\n<p>data[&#39;z_score&#39;] = zscore(data[&#39;precipitation&#39;])<\/p>\n<p>data = data[data[&#39;z_score&#39;].abs() &lt; 3]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u56fe\u8868\u7ed8\u5236\u4e0e\u6837\u5f0f\u8c03\u6574<\/p>\n<\/p>\n<p><p>\u5728\u6570\u636e\u51c6\u5907\u597d\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528Matplotlib\u6216Seaborn\u8fdb\u884c\u56fe\u8868\u7ed8\u5236\u3002<strong>\u5728\u7ed8\u5236\u56fe\u8868\u65f6\uff0c\u56fe\u8868\u7684\u6837\u5f0f\u548c\u7ec6\u8282\u8c03\u6574\u4e5f\u662f\u975e\u5e38\u91cd\u8981\u7684<\/strong>\u3002\u8fd9\u4e9b\u8c03\u6574\u53ef\u4ee5\u5e2e\u52a9\u66f4\u597d\u5730\u5c55\u793a\u6570\u636e\u7684\u7279\u5f81\uff0c\u63d0\u9ad8\u56fe\u8868\u7684\u53ef\u8bfb\u6027\u548c\u7f8e\u89c2\u5ea6\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528Matplotlib\u7ed8\u5236\u56fe\u8868<\/li>\n<\/ol>\n<p><p>Matplotlib\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u7ed8\u56fe\u5e93\u4e4b\u4e00\uff0c\u529f\u80fd\u975e\u5e38\u5f3a\u5927\u3002\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e9b\u53c2\u6570\u8c03\u6574\u6765\u6539\u53d8\u56fe\u8868\u7684\u5916\u89c2\uff0c\u4f8b\u5982\u989c\u8272\u3001\u7ebf\u578b\u3001\u6807\u8bb0\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">plt.plot(data[&#39;date&#39;], data[&#39;precipitation&#39;], color=&#39;b&#39;, linestyle=&#39;-&#39;, marker=&#39;o&#39;)<\/p>\n<p>plt.title(&#39;Precipitation Over Time&#39;)<\/p>\n<p>plt.xlabel(&#39;Date&#39;)<\/p>\n<p>plt.ylabel(&#39;Precipitation (mm)&#39;)<\/p>\n<p>plt.grid(True)<\/p>\n<p>plt.xticks(rotation=45)<\/p>\n<p>plt.tight_layout()<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Seaborn\u8fdb\u884c\u9ad8\u7ea7\u7ed8\u56fe<\/li>\n<\/ol>\n<p><p>Seaborn\u662f\u57fa\u4e8eMatplotlib\u7684\u9ad8\u7ea7\u7ed8\u56fe\u5e93\uff0c\u53ef\u4ee5\u66f4\u5bb9\u6613\u5730\u521b\u5efa\u7f8e\u89c2\u7684\u7edf\u8ba1\u56fe\u8868\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e9b\u9ad8\u7ea7\u529f\u80fd\uff0c\u5982\u81ea\u52a8\u7edf\u8ba1\u6c47\u603b\u3001\u4e3b\u9898\u8bbe\u7f6e\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import seaborn as sns<\/p>\n<p>sns.set_theme(style=&quot;whitegrid&quot;)<\/p>\n<p>sns.lineplot(x=&#39;date&#39;, y=&#39;precipitation&#39;, data=data)<\/p>\n<p>plt.title(&#39;Precipitation Over Time&#39;)<\/p>\n<p>plt.xlabel(&#39;Date&#39;)<\/p>\n<p>plt.ylabel(&#39;Precipitation (mm)&#39;)<\/p>\n<p>plt.xticks(rotation=45)<\/p>\n<p>plt.tight_layout()<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u52a8\u6001\u56fe\u8868\u4e0e\u4ea4\u4e92\u529f\u80fd<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u589e\u5f3a\u6570\u636e\u7684\u53ef\u89c6\u5316\u6548\u679c\u548c\u7528\u6237\u4f53\u9a8c\uff0c\u53ef\u4ee5\u4f7f\u7528Plotly\u5e93\u521b\u5efa\u52a8\u6001\u548c\u4ea4\u4e92\u5f0f\u7684\u56fe\u8868\u3002<strong>Plotly\u5141\u8bb8\u7528\u6237\u5728\u56fe\u8868\u4e2d\u8fdb\u884c\u4ea4\u4e92\uff0c\u5982\u7f29\u653e\u3001\u5e73\u79fb\u3001\u67e5\u770b\u6570\u636e\u70b9\u8be6\u7ec6\u4fe1\u606f\u7b49<\/strong>\u3002\u8fd9\u5bf9\u4e8e\u5206\u6790\u590d\u6742\u7684\u6570\u636e\u96c6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import plotly.express as px<\/p>\n<p>fig = px.line(data, x=&#39;date&#39;, y=&#39;precipitation&#39;, title=&#39;Precipitation Over Time&#39;)<\/p>\n<p>fig.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Plotly\u7684\u4ea4\u4e92\u529f\u80fd\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u66f4\u6df1\u5165\u5730\u63a2\u7d22\u6570\u636e\uff0c\u4f8b\u5982\u5728\u56fe\u8868\u4e0a\u60ac\u505c\u4ee5\u67e5\u770b\u8be6\u7ec6\u4fe1\u606f\uff0c\u6216\u8005\u901a\u8fc7\u7f29\u653e\u529f\u80fd\u67e5\u770b\u7279\u5b9a\u65f6\u95f4\u6bb5\u7684\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u6848\u4f8b\u5206\u6790\u4e0e\u5e94\u7528<\/p>\n<\/p>\n<p><p>\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u964d\u6c34\u56fe\u53ef\u4ee5\u7528\u4e8e\u591a\u79cd\u573a\u666f\uff0c\u5982\u6c14\u5019\u7814\u7a76\u3001\u519c\u4e1a\u7ba1\u7406\u3001\u57ce\u5e02\u89c4\u5212\u7b49\u3002\u5728\u8fd9\u4e9b\u5e94\u7528\u4e2d\uff0c\u964d\u6c34\u56fe\u4e0d\u4ec5\u4ec5\u662f\u4e00\u4e2a\u6570\u636e\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u66f4\u662f\u4e00\u4e2a\u51b3\u7b56\u652f\u6301\u7cfb\u7edf\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6c14\u5019\u7814\u7a76\uff1a\u7814\u7a76\u964d\u6c34\u91cf\u7684\u53d8\u5316\u8d8b\u52bf\u53ef\u4ee5\u5e2e\u52a9\u79d1\u5b66\u5bb6\u4e86\u89e3\u6c14\u5019\u53d8\u5316\u7684\u5f71\u54cd\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u519c\u4e1a\u7ba1\u7406\uff1a\u519c\u6c11\u53ef\u4ee5\u5229\u7528\u964d\u6c34\u56fe\u6765\u89c4\u5212\u4f5c\u7269\u7684\u704c\u6e89\u7b56\u7565\uff0c\u4ece\u800c\u63d0\u9ad8\u4f5c\u7269\u4ea7\u91cf\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u57ce\u5e02\u89c4\u5212\uff1a\u57ce\u5e02\u89c4\u5212\u8005\u53ef\u4ee5\u4f7f\u7528\u964d\u6c34\u6570\u636e\u6765\u8bbe\u8ba1\u6392\u6c34\u7cfb\u7edf\uff0c\u51cf\u5c11\u6d2a\u6c34\u98ce\u9669\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u5b9e\u9645\u6848\u4f8b\u5206\u6790\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u964d\u6c34\u56fe\u5728\u4e0d\u540c\u9886\u57df\u7684\u5e7f\u6cdb\u5e94\u7528\uff0c\u4ee5\u53ca\u5176\u5728\u6570\u636e\u9a71\u52a8\u51b3\u7b56\u4e2d\u7684\u91cd\u8981\u4f5c\u7528\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u603b\u7ed3\u4e0e\u5c55\u671b<\/p>\n<\/p>\n<p><p>\u7ed8\u5236\u964d\u6c34\u56fe\u662f\u6570\u636e\u53ef\u89c6\u5316\u9886\u57df\u7684\u91cd\u8981\u4efb\u52a1\u4e4b\u4e00\u3002<strong>\u901a\u8fc7\u4f7f\u7528Python\u4e2d\u7684Matplotlib\u3001Seaborn\u548cPlotly\u7b49\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u9ad8\u6548\u5730\u521b\u5efa\u5404\u79cd\u7c7b\u578b\u7684\u964d\u6c34\u56fe<\/strong>\u3002\u8fd9\u4e9b\u56fe\u8868\u4e0d\u4ec5\u53ef\u4ee5\u7528\u4e8e\u5c55\u793a\u548c\u5206\u6790\u964d\u6c34\u6570\u636e\uff0c\u8fd8\u53ef\u4ee5\u4e3a\u79d1\u5b66\u7814\u7a76\u548c\u5b9e\u9645\u5e94\u7528\u63d0\u4f9b\u91cd\u8981\u7684\u53c2\u8003\u3002<\/p>\n<\/p>\n<p><p>\u672a\u6765\uff0c\u968f\u7740\u6570\u636e\u91cf\u7684\u589e\u52a0\u548c\u6280\u672f\u7684\u53d1\u5c55\uff0c\u6570\u636e\u53ef\u89c6\u5316\u5c06\u53d8\u5f97\u66f4\u52a0\u91cd\u8981\u3002\u6211\u4eec\u53ef\u4ee5\u671f\u5f85\u66f4\u591a\u7684\u521b\u65b0\u5de5\u5177\u548c\u65b9\u6cd5\u6765\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7406\u89e3\u548c\u5229\u7528\u6570\u636e\u3002\u901a\u8fc7\u4e0d\u65ad\u5b66\u4e60\u548c\u5b9e\u8df5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u6570\u636e\u79d1\u5b66\u9886\u57df\u521b\u9020\u66f4\u591a\u7684\u4ef7\u503c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u7ed8\u5236\u964d\u6c34\u56fe\u7684\u57fa\u7840\u5e93\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u7ed8\u5236\u964d\u6c34\u56fe\u901a\u5e38\u9700\u8981\u4f9d\u8d56\u4e8e\u51e0\u4e2a\u5f3a\u5927\u7684\u5e93\u3002\u6700\u5e38\u7528\u7684\u5e93\u5305\u62ecMatplotlib\u3001Pandas\u548cSeaborn\u3002Matplotlib\u662f\u4e00\u4e2a\u7ed8\u56fe\u5e93\uff0c\u652f\u6301\u5404\u79cd\u9759\u6001\u3001\u52a8\u6001\u548c\u4ea4\u4e92\u5f0f\u56fe\u5f62\u7684\u7ed8\u5236\uff1bPandas\u63d0\u4f9b\u4e86\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u7684\u529f\u80fd\uff0c\u975e\u5e38\u9002\u5408\u5904\u7406\u65f6\u95f4\u5e8f\u5217\u6570\u636e\uff1bSeaborn\u5219\u5728Matplotlib\u7684\u57fa\u7840\u4e0a\u63d0\u4f9b\u4e86\u66f4\u7f8e\u89c2\u7684\u7edf\u8ba1\u56fe\u5f62\u3002\u6b64\u5916\uff0cCartopy\u548cBasemap\u4e5f\u53ef\u4ee5\u7528\u4e8e\u7ed8\u5236\u5730\u7406\u4fe1\u606f\u76f8\u5173\u7684\u964d\u6c34\u56fe\u3002<\/p>\n<p><strong>\u6211\u9700\u8981\u51c6\u5907\u54ea\u4e9b\u6570\u636e\u624d\u80fd\u7ed8\u5236\u964d\u6c34\u56fe\uff1f<\/strong><br \/>\u7ed8\u5236\u964d\u6c34\u56fe\u9700\u8981\u6536\u96c6\u548c\u51c6\u5907\u76f8\u5173\u7684\u6c14\u8c61\u6570\u636e\u3002\u8fd9\u4e9b\u6570\u636e\u901a\u5e38\u5305\u62ec\u65f6\u95f4\u6233\u3001\u964d\u6c34\u91cf\u3001\u5730\u7406\u5750\u6807\uff08\u7ecf\u7eac\u5ea6\uff09\u7b49\u4fe1\u606f\u3002\u5e38\u89c1\u7684\u6570\u636e\u6e90\u5305\u62ec\u6c14\u8c61\u5c40\u53d1\u5e03\u7684\u5386\u53f2\u6c14\u8c61\u6570\u636e\u3001\u9065\u611f\u6570\u636e\u6216\u8005\u6c14\u5019\u6a21\u578b\u8f93\u51fa\u3002\u786e\u4fdd\u6570\u636e\u683c\u5f0f\u6b63\u786e\uff0c\u4f8b\u5982\u4f7f\u7528CSV\u6216Excel\u6587\u4ef6\uff0c\u5e76\u5305\u542b\u5fc5\u8981\u7684\u5b57\u6bb5\uff0c\u4ee5\u4fbf\u540e\u7eed\u7684\u6570\u636e\u5904\u7406\u548c\u53ef\u89c6\u5316\u3002<\/p>\n<p><strong>\u7ed8\u5236\u964d\u6c34\u56fe\u65f6\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684\u56fe\u8868\u7c7b\u578b\uff1f<\/strong><br \/>\u9009\u62e9\u5408\u9002\u7684\u56fe\u8868\u7c7b\u578b\u5bf9\u4e8e\u6e05\u6670\u4f20\u8fbe\u4fe1\u606f\u81f3\u5173\u91cd\u8981\u3002\u964d\u6c34\u56fe\u901a\u5e38\u4f7f\u7528\u6298\u7ebf\u56fe\u3001\u67f1\u72b6\u56fe\u6216\u70ed\u56fe\u6765\u5c55\u793a\u964d\u6c34\u91cf\u7684\u53d8\u5316\u8d8b\u52bf\u3002\u5982\u679c\u662f\u5c55\u793a\u65f6\u95f4\u5e8f\u5217\u6570\u636e\uff0c\u6298\u7ebf\u56fe\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff1b\u5982\u679c\u9700\u8981\u6bd4\u8f83\u4e0d\u540c\u5730\u70b9\u7684\u964d\u6c34\u91cf\uff0c\u67f1\u72b6\u56fe\u4f1a\u66f4\u52a0\u76f4\u89c2\u3002\u800c\u70ed\u56fe\u5219\u9002\u7528\u4e8e\u5c55\u793a\u7a7a\u95f4\u5206\u5e03\uff0c\u5c24\u5176\u662f\u5f53\u6d89\u53ca\u5230\u591a\u4e2a\u5730\u70b9\u7684\u964d\u6c34\u91cf\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u989c\u8272\u6df1\u6d45\u6765\u53cd\u6620\u964d\u6c34\u5f3a\u5ea6\u3002\u6839\u636e\u6570\u636e\u7684\u7279\u70b9\u548c\u5206\u6790\u7684\u76ee\u7684\uff0c\u9009\u62e9\u5408\u9002\u7684\u56fe\u8868\u7c7b\u578b\u53ef\u4ee5\u6709\u6548\u63d0\u5347\u4fe1\u606f\u7684\u53ef\u8bfb\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u7ed8\u5236\u964d\u6c34\u56fe\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u4e00\u4e9b\u6570\u636e\u53ef\u89c6\u5316\u5e93\u3002\u4e3b\u8981\u5de5\u5177\u5305\u62ecMatplotlib\u3001Seaborn\u3001 [&hellip;]","protected":false},"author":3,"featured_media":1020565,"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\/1020560"}],"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=1020560"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1020560\/revisions"}],"predecessor-version":[{"id":1020566,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1020560\/revisions\/1020566"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1020565"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1020560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1020560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1020560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}