{"id":1067913,"date":"2024-12-31T16:38:40","date_gmt":"2024-12-31T08:38:40","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1067913.html"},"modified":"2024-12-31T16:38:43","modified_gmt":"2024-12-31T08:38:43","slug":"python%e5%a6%82%e4%bd%95%e6%8a%bd%e5%8f%96%e6%95%b0%e6%8d%ae%e5%81%9a%e5%8f%af%e8%a7%86%e5%8c%96%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1067913.html","title":{"rendered":"python\u5982\u4f55\u62bd\u53d6\u6570\u636e\u505a\u53ef\u89c6\u5316\u5206\u6790"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/b5b1721f-f99a-46f1-8448-48b0180f53a5.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u62bd\u53d6\u6570\u636e\u505a\u53ef\u89c6\u5316\u5206\u6790\" \/><\/p>\n<p><p> <strong>Python\u62bd\u53d6\u6570\u636e\u505a\u53ef\u89c6\u5316\u5206\u6790\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Pandas\u8fdb\u884c\u6570\u636e\u8bfb\u53d6\u548c\u5904\u7406\u3001\u5229\u7528Matplotlib\u548cSeaborn\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u3001\u7ed3\u5408Plotly\u8fdb\u884c\u4ea4\u4e92\u5f0f\u56fe\u8868\u521b\u5efa\u3002<\/strong> \u5176\u4e2d\uff0cPandas\u662f\u6570\u636e\u5206\u6790\u7684\u57fa\u7840\u5e93\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u6570\u636e\u8bfb\u53d6\u548c\u9884\u5904\u7406\uff1bMatplotlib\u548cSeaborn\u5219\u662f\u5f3a\u5927\u7684\u6570\u636e\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u80fd\u591f\u7ed8\u5236\u5404\u79cd\u9759\u6001\u56fe\u8868\uff1b\u800cPlotly\u5219\u80fd\u521b\u5efa\u4ea4\u4e92\u5f0f\u56fe\u8868\uff0c\u63d0\u5347\u6570\u636e\u5c55\u793a\u6548\u679c\u3002\u4e0b\u9762\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u8fd9\u4e9b\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001PANDAS\u6570\u636e\u8bfb\u53d6\u4e0e\u5904\u7406<\/h3>\n<\/p>\n<p><p>Pandas\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u6570\u636e\u5206\u6790\u5e93\u4e4b\u4e00\uff0c\u5b83\u80fd\u591f\u9ad8\u6548\u5730\u8bfb\u53d6\u3001\u6e05\u6d17\u548c\u5904\u7406\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Pandas\u8fdb\u884c\u6570\u636e\u8bfb\u53d6\u548c\u5904\u7406\u7684\u4e00\u4e9b\u5e38\u89c1\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001\u8bfb\u53d6\u6570\u636e<\/h4>\n<\/p>\n<p><p>Pandas\u80fd\u591f\u8bfb\u53d6\u591a\u79cd\u683c\u5f0f\u7684\u6570\u636e\u6587\u4ef6\uff0c\u5305\u62ecCSV\u3001Excel\u3001SQL\u7b49\u3002\u4ee5\u4e0b\u662f\u8bfb\u53d6CSV\u6587\u4ef6\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6<\/strong><\/h2>\n<p>data = pd.read_csv(&#39;data.csv&#39;)<\/p>\n<h2><strong>\u67e5\u770b\u6570\u636e\u7684\u524d\u51e0\u884c<\/strong><\/h2>\n<p>print(data.head())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6570\u636e\u6e05\u6d17<\/h4>\n<\/p>\n<p><p>\u6570\u636e\u6e05\u6d17\u662f\u6570\u636e\u5206\u6790\u4e2d\u975e\u5e38\u91cd\u8981\u7684\u4e00\u6b65\uff0c\u5e38\u89c1\u7684\u6e05\u6d17\u64cd\u4f5c\u5305\u62ec\u5904\u7406\u7f3a\u5931\u503c\u3001\u5220\u9664\u91cd\u590d\u6570\u636e\u3001\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u6570\u636e\u6e05\u6d17\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u67e5\u770b\u6570\u636e\u7684\u57fa\u672c\u4fe1\u606f<\/p>\n<p>print(data.info())<\/p>\n<h2><strong>\u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u884c<\/strong><\/h2>\n<p>data = data.dropna()<\/p>\n<h2><strong>\u586b\u5145\u7f3a\u5931\u503c<\/strong><\/h2>\n<p>data = data.fillna(0)<\/p>\n<h2><strong>\u5220\u9664\u91cd\u590d\u884c<\/strong><\/h2>\n<p>data = data.drop_duplicates()<\/p>\n<h2><strong>\u8f6c\u6362\u6570\u636e\u7c7b\u578b<\/strong><\/h2>\n<p>data[&#39;column_name&#39;] = data[&#39;column_name&#39;].astype(int)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u6570\u636e\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u6570\u636e\u5904\u7406\u5305\u62ec\u6570\u636e\u7b5b\u9009\u3001\u5206\u7ec4\u3001\u805a\u5408\u7b49\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u6570\u636e\u5904\u7406\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u7b5b\u9009\u6570\u636e<\/p>\n<p>filtered_data = data[data[&#39;column_name&#39;] &gt; 10]<\/p>\n<h2><strong>\u5206\u7ec4\u6570\u636e\u5e76\u8ba1\u7b97\u5747\u503c<\/strong><\/h2>\n<p>grouped_data = data.groupby(&#39;group_column&#39;).mean()<\/p>\n<h2><strong>\u8ba1\u7b97\u6307\u5b9a\u5217\u7684\u603b\u548c<\/strong><\/h2>\n<p>sum_data = data[&#39;column_name&#39;].sum()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001MATPLOTLIB\u548cSEABORN\u6570\u636e\u53ef\u89c6\u5316<\/h3>\n<\/p>\n<p><p>Matplotlib\u548cSeaborn\u662fPython\u4e2d\u6700\u5e38\u7528\u7684\u4e24\u4e2a\u6570\u636e\u53ef\u89c6\u5316\u5e93\uff0c\u5b83\u4eec\u53ef\u4ee5\u751f\u6210\u5404\u79cd\u9759\u6001\u56fe\u8868\uff0c\u5305\u62ec\u6298\u7ebf\u56fe\u3001\u67f1\u72b6\u56fe\u3001\u6563\u70b9\u56fe\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1\u3001Matplotlib<\/h4>\n<\/p>\n<p><p>Matplotlib\u662f\u4e00\u4e2a\u4f4e\u7ea7\u522b\u7684\u7ed8\u56fe\u5e93\uff0c\u5177\u6709\u9ad8\u5ea6\u7684\u81ea\u5b9a\u4e49\u80fd\u529b\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Matplotlib\u7ed8\u5236\u6298\u7ebf\u56fe\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\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;x_column&#39;], data[&#39;y_column&#39;])<\/p>\n<p>plt.xlabel(&#39;X\u8f74\u6807\u7b7e&#39;)<\/p>\n<p>plt.ylabel(&#39;Y\u8f74\u6807\u7b7e&#39;)<\/p>\n<p>plt.title(&#39;\u6298\u7ebf\u56fe\u6807\u9898&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001Seaborn<\/h4>\n<\/p>\n<p><p>Seaborn\u662f\u57fa\u4e8eMatplotlib\u7684\u9ad8\u7ea7\u7ed8\u56fe\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u7b80\u4fbf\u7684API\u548c\u7f8e\u89c2\u7684\u9ed8\u8ba4\u6837\u5f0f\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Seaborn\u7ed8\u5236\u67f1\u72b6\u56fe\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import seaborn as sns<\/p>\n<h2><strong>\u7ed8\u5236\u67f1\u72b6\u56fe<\/strong><\/h2>\n<p>sns.barplot(x=&#39;x_column&#39;, y=&#39;y_column&#39;, data=data)<\/p>\n<p>plt.xlabel(&#39;X\u8f74\u6807\u7b7e&#39;)<\/p>\n<p>plt.ylabel(&#39;Y\u8f74\u6807\u7b7e&#39;)<\/p>\n<p>plt.title(&#39;\u67f1\u72b6\u56fe\u6807\u9898&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001PLOTLY\u4ea4\u4e92\u5f0f\u56fe\u8868<\/h3>\n<\/p>\n<p><p>Plotly\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7ed8\u56fe\u5e93\uff0c\u80fd\u591f\u751f\u6210\u4ea4\u4e92\u5f0f\u56fe\u8868\uff0c\u63d0\u5347\u6570\u636e\u5c55\u793a\u6548\u679c\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Plotly\u7ed8\u5236\u4ea4\u4e92\u5f0f\u6298\u7ebf\u56fe\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import plotly.express as px<\/p>\n<h2><strong>\u7ed8\u5236\u4ea4\u4e92\u5f0f\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>fig = px.line(data, x=&#39;x_column&#39;, y=&#39;y_column&#39;, title=&#39;\u4ea4\u4e92\u5f0f\u6298\u7ebf\u56fe\u6807\u9898&#39;)<\/p>\n<p>fig.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u6848\u4f8b\u5206\u6790\uff1a\u4ece\u6570\u636e\u8bfb\u53d6\u5230\u53ef\u89c6\u5316<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u4e0b\u9762\u6211\u4eec\u901a\u8fc7\u4e00\u4e2a\u5177\u4f53\u7684\u6848\u4f8b\u8fdb\u884c\u8bb2\u89e3\u3002\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u5305\u542b\u9500\u552e\u6570\u636e\u7684CSV\u6587\u4ef6\uff0c\u6211\u4eec\u5c06\u4ece\u6570\u636e\u8bfb\u53d6\u3001\u6e05\u6d17\u3001\u5904\u7406\u5230\u53ef\u89c6\u5316\u7684\u6574\u4e2a\u6d41\u7a0b\u8fdb\u884c\u5c55\u793a\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u8bfb\u53d6\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u8bfb\u53d6CSV\u6587\u4ef6\u4e2d\u7684\u6570\u636e\uff0c\u5e76\u67e5\u770b\u6570\u636e\u7684\u57fa\u672c\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6CSV\u6587\u4ef6<\/strong><\/h2>\n<p>sales_data = pd.read_csv(&#39;sales_data.csv&#39;)<\/p>\n<h2><strong>\u67e5\u770b\u6570\u636e\u7684\u57fa\u672c\u4fe1\u606f<\/strong><\/h2>\n<p>print(sales_data.info())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6570\u636e\u6e05\u6d17<\/h4>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5bf9\u6570\u636e\u8fdb\u884c\u6e05\u6d17\uff0c\u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u884c\uff0c\u5e76\u8f6c\u6362\u6570\u636e\u7c7b\u578b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u884c<\/p>\n<p>sales_data = sales_data.dropna()<\/p>\n<h2><strong>\u8f6c\u6362\u6570\u636e\u7c7b\u578b<\/strong><\/h2>\n<p>sales_data[&#39;sales&#39;] = sales_data[&#39;sales&#39;].astype(float)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u6570\u636e\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u5bf9\u6570\u636e\u8fdb\u884c\u5206\u7ec4\uff0c\u5e76\u8ba1\u7b97\u6bcf\u4e2a\u6708\u7684\u9500\u552e\u603b\u989d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u63d0\u53d6\u6708\u4efd\u4fe1\u606f<\/p>\n<p>sales_data[&#39;month&#39;] = pd.to_datetime(sales_data[&#39;date&#39;]).dt.month<\/p>\n<h2><strong>\u6309\u6708\u4efd\u5206\u7ec4\u5e76\u8ba1\u7b97\u9500\u552e\u603b\u989d<\/strong><\/h2>\n<p>monthly_sales = sales_data.groupby(&#39;month&#39;)[&#39;sales&#39;].sum().reset_index()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001\u6570\u636e\u53ef\u89c6\u5316<\/h4>\n<\/p>\n<p><p>\u6700\u540e\uff0c\u6211\u4eec\u4f7f\u7528Matplotlib\u548cSeaborn\u5bf9\u6570\u636e\u8fdb\u884c\u53ef\u89c6\u5316\u5c55\u793a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import matplotlib.pyplot as plt<\/p>\n<p>import seaborn as sns<\/p>\n<h2><strong>\u4f7f\u7528Matplotlib\u7ed8\u5236\u6298\u7ebf\u56fe<\/strong><\/h2>\n<p>plt.plot(monthly_sales[&#39;month&#39;], monthly_sales[&#39;sales&#39;])<\/p>\n<p>plt.xlabel(&#39;\u6708\u4efd&#39;)<\/p>\n<p>plt.ylabel(&#39;\u9500\u552e\u603b\u989d&#39;)<\/p>\n<p>plt.title(&#39;\u6bcf\u6708\u9500\u552e\u603b\u989d\u6298\u7ebf\u56fe&#39;)<\/p>\n<p>plt.show()<\/p>\n<h2><strong>\u4f7f\u7528Seaborn\u7ed8\u5236\u67f1\u72b6\u56fe<\/strong><\/h2>\n<p>sns.barplot(x=&#39;month&#39;, y=&#39;sales&#39;, data=monthly_sales)<\/p>\n<p>plt.xlabel(&#39;\u6708\u4efd&#39;)<\/p>\n<p>plt.ylabel(&#39;\u9500\u552e\u603b\u989d&#39;)<\/p>\n<p>plt.title(&#39;\u6bcf\u6708\u9500\u552e\u603b\u989d\u67f1\u72b6\u56fe&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c<strong>Python\u4e2d\u8fdb\u884c\u6570\u636e\u62bd\u53d6\u548c\u53ef\u89c6\u5316\u5206\u6790\u7684\u6d41\u7a0b\u5305\u62ec\u6570\u636e\u8bfb\u53d6\u3001\u6570\u636e\u6e05\u6d17\u3001\u6570\u636e\u5904\u7406\u4ee5\u53ca\u6570\u636e\u53ef\u89c6\u5316<\/strong>\u3002Pandas\u3001Matplotlib\u3001Seaborn\u548cPlotly\u662f\u5b8c\u6210\u8fd9\u4e9b\u4efb\u52a1\u7684\u91cd\u8981\u5de5\u5177\u3002\u638c\u63e1\u8fd9\u4e9b\u5de5\u5177\u548c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u5c55\u793a\uff0c\u63d0\u5347\u6570\u636e\u5206\u6790\u7684\u6548\u7387\u548c\u6548\u679c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u6570\u636e\u62bd\u53d6\u548c\u53ef\u89c6\u5316\u5206\u6790\u7684\u5165\u95e8\u6b65\u9aa4\uff1f<\/strong><br \/>\u5728\u8fdb\u884c\u6570\u636e\u62bd\u53d6\u548c\u53ef\u89c6\u5316\u5206\u6790\u65f6\uff0c\u9996\u5148\u9700\u8981\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u548c\u5e93\u3002Pandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u6570\u636e\u8bfb\u53d6\u548c\u64cd\u4f5c\u3002Matplotlib\u548cSeaborn\u662f\u5e38\u7528\u7684\u53ef\u89c6\u5316\u5e93\uff0c\u80fd\u591f\u521b\u5efa\u5404\u79cd\u56fe\u8868\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5\u8fd9\u4e9b\u5e93\u6765\u5f00\u59cb\uff0c\u4f7f\u7528Pandas\u8bfb\u53d6CSV\u6216Excel\u6587\u4ef6\uff0c\u7136\u540e\u5229\u7528Matplotlib\u548cSeaborn\u751f\u6210\u53ef\u89c6\u5316\u56fe\u5f62\u3002\u5177\u4f53\u6b65\u9aa4\u5305\u62ec\uff1a\u5bfc\u5165\u5e93\u3001\u8bfb\u53d6\u6570\u636e\u3001\u6570\u636e\u6e05\u6d17\u3001\u9009\u62e9\u8981\u53ef\u89c6\u5316\u7684\u53d8\u91cf\u3001\u7ed8\u5236\u56fe\u8868\u7b49\u3002<\/p>\n<p><strong>Python\u4e2d\u6709\u54ea\u4e9b\u5e38\u7528\u7684\u6570\u636e\u53ef\u89c6\u5316\u5e93\uff1f<\/strong><br \/>Python\u4e2d\u6709\u591a\u79cd\u6d41\u884c\u7684\u6570\u636e\u53ef\u89c6\u5316\u5e93\uff0c\u6700\u5e38\u7528\u7684\u5305\u62ecMatplotlib\u3001Seaborn\u3001Plotly\u548cBokeh\u3002Matplotlib\u63d0\u4f9b\u57fa\u7840\u7ed8\u56fe\u529f\u80fd\uff0cSeaborn\u5728\u5176\u4e0a\u8fdb\u884c\u4e86\u7f8e\u5316\uff0c\u9002\u5408\u7edf\u8ba1\u6570\u636e\u7684\u53ef\u89c6\u5316\u3002Plotly\u5219\u652f\u6301\u4ea4\u4e92\u5f0f\u56fe\u8868\uff0c\u975e\u5e38\u9002\u5408\u7528\u4e8e\u7f51\u9875\u5c55\u793a\u3002Bokeh\u540c\u6837\u63d0\u4f9b\u4ea4\u4e92\u5f0f\u56fe\u8868\uff0c\u5e76\u4e14\u9002\u5408\u5904\u7406\u5927\u6570\u636e\u96c6\u3002\u6839\u636e\u4f60\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u5347\u6570\u636e\u5206\u6790\u7684\u6548\u679c\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u6570\u636e\u4e2d\u7684\u7f3a\u5931\u503c\u4ee5\u4fbf\u8fdb\u884c\u53ef\u89c6\u5316\u5206\u6790\uff1f<\/strong><br \/>\u5728\u6570\u636e\u5206\u6790\u4e2d\uff0c\u7f3a\u5931\u503c\u662f\u4e00\u4e2a\u5e38\u89c1\u95ee\u9898\uff0c\u5904\u7406\u65b9\u5f0f\u6709\u591a\u79cd\u3002\u53ef\u4ee5\u9009\u62e9\u5220\u9664\u542b\u7f3a\u5931\u503c\u7684\u884c\u6216\u5217\uff0c\u9002\u5408\u7f3a\u5931\u503c\u8f83\u5c11\u7684\u60c5\u51b5\u3002\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u7528\u5747\u503c\u3001\u4e2d\u4f4d\u6570\u6216\u4f17\u6570\u586b\u5145\u7f3a\u5931\u503c\uff0c\u8fd9\u6837\u80fd\u591f\u4fdd\u7559\u66f4\u591a\u7684\u6570\u636e\u3002Pandas\u5e93\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u65b9\u6cd5\u6765\u5904\u7406\u7f3a\u5931\u503c\uff0c\u4f8b\u5982<code>dropna()<\/code>\u548c<code>fillna()<\/code>\u51fd\u6570\u3002\u9009\u62e9\u9002\u5408\u7684\u6570\u636e\u5904\u7406\u65b9\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u53ef\u89c6\u5316\u5206\u6790\u7684\u51c6\u786e\u6027\u548c\u6709\u6548\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u62bd\u53d6\u6570\u636e\u505a\u53ef\u89c6\u5316\u5206\u6790\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Pandas\u8fdb\u884c\u6570\u636e\u8bfb\u53d6\u548c\u5904\u7406\u3001\u5229\u7528Matplotlib\u548cSe [&hellip;]","protected":false},"author":3,"featured_media":1067924,"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\/1067913"}],"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=1067913"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1067913\/revisions"}],"predecessor-version":[{"id":1067928,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1067913\/revisions\/1067928"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1067924"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1067913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1067913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1067913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}