{"id":996633,"date":"2024-12-27T09:16:38","date_gmt":"2024-12-27T01:16:38","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/996633.html"},"modified":"2024-12-27T09:16:40","modified_gmt":"2024-12-27T01:16:40","slug":"python%e5%a6%82%e4%bd%95%e5%8e%bb%e9%99%a4%e7%bc%ba%e6%8d%9f%e5%80%bc","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/996633.html","title":{"rendered":"Python\u5982\u4f55\u53bb\u9664\u7f3a\u635f\u503c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25072805\/d1eebe9c-75a3-42e4-911a-1cdf96915a2c.webp\" alt=\"Python\u5982\u4f55\u53bb\u9664\u7f3a\u635f\u503c\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u53bb\u9664\u7f3a\u635f\u503c\u7684\u5e38\u7528\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Pandas\u5e93\u7684dropna()\u51fd\u6570\u5220\u9664\u5305\u542b\u7f3a\u635f\u503c\u7684\u884c\u6216\u5217\u3001\u4f7f\u7528fillna()\u51fd\u6570\u586b\u5145\u7f3a\u635f\u503c\u3001\u901a\u8fc7\u63d2\u503c\u6cd5\u8fdb\u884c\u7f3a\u635f\u503c\u7684\u63a8\u6d4b\u548c\u586b\u8865\u3002<\/strong>\u5176\u4e2d\uff0c\u4f7f\u7528dropna()\u51fd\u6570\u662f\u6700\u4e3a\u76f4\u63a5\u7684\u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u5feb\u901f\u5730\u5220\u9664\u4efb\u4f55\u5305\u542b\u7f3a\u635f\u503c\u7684\u6570\u636e\u884c\u6216\u5217\uff0c\u4ece\u800c\u7b80\u5316\u6570\u636e\u96c6\uff0c\u65b9\u4fbf\u540e\u7eed\u5206\u6790\u3002\u4e0d\u8fc7\uff0c\u8fd9\u79cd\u65b9\u6cd5\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u7684\u635f\u5931\uff0c\u56e0\u6b64\u5728\u4f7f\u7528\u524d\u9700\u8981\u4ed4\u7ec6\u8003\u8651\u6570\u636e\u7684\u91cd\u8981\u6027\u548c\u5b8c\u6574\u6027\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001PANDAS\u5e93\u7684DROPNA()\u51fd\u6570<\/p>\n<\/p>\n<p><p>Pandas\u5e93\u662fPython\u6570\u636e\u5206\u6790\u7684\u5f3a\u5927\u5de5\u5177\u4e4b\u4e00\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u51fd\u6570\u6765\u5904\u7406\u7f3a\u635f\u503c\u3002\u4f7f\u7528dropna()\u51fd\u6570\u53ef\u4ee5\u65b9\u4fbf\u5730\u5220\u9664\u5305\u542b\u7f3a\u635f\u503c\u7684\u884c\u6216\u5217\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528dropna()\u5220\u9664\u884c<\/li>\n<\/ol>\n<p><p>\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u5e0c\u671b\u5220\u9664\u6570\u636e\u96c6\u4e2d\u4efb\u4f55\u5305\u542b\u7f3a\u635f\u503c\u7684\u884c\u3002\u53ef\u4ee5\u901a\u8fc7\u8c03\u7528dropna()\u51fd\u6570\u5e76\u8bbe\u7f6eaxis\u53c2\u6570\u4e3a0\uff08\u9ed8\u8ba4\u503c\uff09\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u6570\u636e\u96c6\u4e2d\u53ea\u4fdd\u7559\u5b8c\u6574\u7684\u8bb0\u5f55\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>data = {<\/p>\n<p>    &#39;A&#39;: [1, 2, None, 4],<\/p>\n<p>    &#39;B&#39;: [5, None, None, 8],<\/p>\n<p>    &#39;C&#39;: [9, 10, 11, 12]<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<h2><strong>\u5220\u9664\u5305\u542b\u7f3a\u635f\u503c\u7684\u884c<\/strong><\/h2>\n<p>df_cleaned = df.dropna()<\/p>\n<p>print(df_cleaned)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528dropna()\u5220\u9664\u5217<\/li>\n<\/ol>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u67d0\u4e9b\u5217\u53ef\u80fd\u5305\u542b\u5927\u91cf\u7f3a\u635f\u503c\uff0c\u8fd9\u65f6\u53ef\u4ee5\u9009\u62e9\u5220\u9664\u8fd9\u4e9b\u5217\u3002\u901a\u8fc7\u8bbe\u7f6eaxis\u53c2\u6570\u4e3a1\uff0c\u53ef\u4ee5\u5220\u9664\u5305\u542b\u7f3a\u635f\u503c\u7684\u5217\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5220\u9664\u5305\u542b\u7f3a\u635f\u503c\u7684\u5217<\/p>\n<p>df_cleaned_columns = df.dropna(axis=1)<\/p>\n<p>print(df_cleaned_columns)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u586b\u5145\u7f3a\u635f\u503c<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4e0d\u5e0c\u671b\u5220\u9664\u4efb\u4f55\u6570\u636e\uff0c\u800c\u662f\u5e0c\u671b\u7528\u5408\u7406\u7684\u503c\u6765\u586b\u5145\u7f3a\u635f\u503c\u3002Pandas\u7684fillna()\u51fd\u6570\u5141\u8bb8\u6211\u4eec\u7528\u6307\u5b9a\u7684\u65b9\u6cd5\u6765\u586b\u8865\u7f3a\u635f\u503c\u3002<\/p>\n<\/p>\n<ol>\n<li>\u7528\u5e38\u6570\u586b\u5145<\/li>\n<\/ol>\n<p><p>\u53ef\u4ee5\u4f7f\u7528fillna()\u51fd\u6570\u7528\u5e38\u6570\u66ff\u6362\u7f3a\u635f\u503c\uff0c\u8fd9\u5728\u7f3a\u635f\u503c\u8f83\u5c11\u6216\u5e38\u6570\u66ff\u6362\u5408\u7406\u65f6\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u75280\u586b\u5145\u7f3a\u635f\u503c<\/p>\n<p>df_filled = df.fillna(0)<\/p>\n<p>print(df_filled)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u7528\u524d\u4e00\u4e2a\u6216\u540e\u4e00\u4e2a\u503c\u586b\u5145<\/li>\n<\/ol>\n<p><p>\u53ef\u4ee5\u4f7f\u7528\u65b9\u6cd5\u53c2\u6570\u6307\u5b9a\u7528\u524d\u4e00\u4e2a\u6709\u6548\u503c\uff08ffill\uff09\u6216\u540e\u4e00\u4e2a\u6709\u6548\u503c\uff08bfill\uff09\u6765\u586b\u5145\u7f3a\u635f\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u7528\u524d\u4e00\u4e2a\u503c\u586b\u5145\u7f3a\u635f\u503c<\/p>\n<p>df_ffill = df.fillna(method=&#39;ffill&#39;)<\/p>\n<p>print(df_ffill)<\/p>\n<h2><strong>\u7528\u540e\u4e00\u4e2a\u503c\u586b\u5145\u7f3a\u635f\u503c<\/strong><\/h2>\n<p>df_bfill = df.fillna(method=&#39;bfill&#39;)<\/p>\n<p>print(df_bfill)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u63d2\u503c\u6cd5\u586b\u8865\u7f3a\u635f\u503c<\/p>\n<\/p>\n<p><p>\u63d2\u503c\u6cd5\u662f\u4e00\u79cd\u5e38\u7528\u7684\u586b\u8865\u7f3a\u635f\u503c\u7684\u65b9\u6cd5\uff0c\u5c24\u5176\u9002\u7528\u4e8e\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u3002Pandas\u63d0\u4f9b\u4e86interpolate()\u51fd\u6570\u6765\u8fdb\u884c\u63d2\u503c\u3002<\/p>\n<\/p>\n<ol>\n<li>\u7ebf\u6027\u63d2\u503c<\/li>\n<\/ol>\n<p><p>\u7ebf\u6027\u63d2\u503c\u662f\u6700\u7b80\u5355\u7684\u63d2\u503c\u65b9\u6cd5\u4e4b\u4e00\uff0c\u5b83\u5047\u8bbe\u7f3a\u635f\u503c\u5728\u90bb\u8fd1\u503c\u4e4b\u95f4\u7ebf\u6027\u53d8\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u7ebf\u6027\u63d2\u503c<\/p>\n<p>df_interpolated = df.interpolate(method=&#39;linear&#39;)<\/p>\n<p>print(df_interpolated)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u591a\u9879\u5f0f\u63d2\u503c<\/li>\n<\/ol>\n<p><p>\u5bf9\u4e8e\u975e\u7ebf\u6027\u6570\u636e\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u66f4\u590d\u6742\u7684\u63d2\u503c\u65b9\u6cd5\uff0c\u5982\u591a\u9879\u5f0f\u63d2\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u591a\u9879\u5f0f\u63d2\u503c\uff08\u4f8b\u5982\u4e8c\u6b21\u591a\u9879\u5f0f\uff09<\/p>\n<p>df_poly_interpolated = df.interpolate(method=&#39;polynomial&#39;, order=2)<\/p>\n<p>print(df_poly_interpolated)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u5904\u7406\u7f3a\u635f\u503c\u7684\u7b56\u7565\u9009\u62e9<\/p>\n<\/p>\n<p><p>\u5728\u5904\u7406\u7f3a\u635f\u503c\u65f6\uff0c\u9009\u62e9\u5408\u9002\u7684\u7b56\u7565\u81f3\u5173\u91cd\u8981\u3002\u8fd9\u9700\u8981\u8003\u8651\u6570\u636e\u7684\u6027\u8d28\u3001\u7f3a\u635f\u503c\u7684\u6570\u91cf\u4ee5\u53ca\u6570\u636e\u5206\u6790\u7684\u76ee\u6807\u3002<\/p>\n<\/p>\n<ol>\n<li>\u6570\u636e\u5b8c\u6574\u6027\u4e0e\u5206\u6790\u76ee\u6807<\/li>\n<\/ol>\n<p><p>\u5728\u9009\u62e9\u5220\u9664\u7f3a\u635f\u503c\u8fd8\u662f\u586b\u8865\u7f3a\u635f\u503c\u4e4b\u524d\uff0c\u9996\u5148\u8981\u660e\u786e\u6570\u636e\u5b8c\u6574\u6027\u548c\u5206\u6790\u76ee\u6807\u3002\u5982\u679c\u7f3a\u635f\u503c\u8f83\u5c11\u4e14\u4e0d\u5f71\u54cd\u6574\u4f53\u5206\u6790\uff0c\u53ef\u4ee5\u9009\u62e9\u5220\u9664\uff1b\u5982\u679c\u6570\u636e\u91cf\u5b9d\u8d35\u4e14\u7f3a\u635f\u503c\u8f83\u591a\uff0c\u586b\u8865\u53ef\u80fd\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u586b\u8865\u7b56\u7565<\/li>\n<\/ol>\n<p><p>\u5bf9\u4e8e\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\uff0c\u53ef\u80fd\u9700\u8981\u4e0d\u540c\u7684\u586b\u8865\u7b56\u7565\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e\u65f6\u95f4\u5e8f\u5217\u6570\u636e\uff0c\u63d2\u503c\u6cd5\u53ef\u80fd\u66f4\u5408\u9002\uff1b\u5bf9\u4e8e\u5206\u7c7b\u6570\u636e\uff0c\u53ef\u4ee5\u7528\u51fa\u73b0\u9891\u7387\u6700\u9ad8\u7684\u7c7b\u522b\u586b\u8865\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u8bc4\u4f30\u586b\u8865\u6548\u679c<\/li>\n<\/ol>\n<p><p>\u65e0\u8bba\u9009\u62e9\u4f55\u79cd\u586b\u8865\u7b56\u7565\uff0c\u8bc4\u4f30\u586b\u8865\u6548\u679c\u90fd\u662f\u5fc5\u8981\u7684\u3002\u53ef\u4ee5\u901a\u8fc7\u5bf9\u6bd4\u586b\u8865\u524d\u540e\u7684\u6570\u636e\u5206\u5e03\u3001\u7edf\u8ba1\u7279\u5f81\u7b49\u6765\u8bc4\u4f30\u586b\u8865\u6548\u679c\u662f\u5426\u5408\u7406\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u5b9e\u6218\u6848\u4f8b\uff1a\u5904\u7406\u7f3a\u635f\u6570\u636e<\/p>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2a\u5b9e\u9645\u6848\u4f8b\u6765\u6f14\u793a\u5982\u4f55\u5904\u7406\u7f3a\u635f\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u5305\u542b\u591a\u4e2a\u80a1\u7968\u4ef7\u683c\u7684\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u96c6\uff0c\u5176\u4e2d\u4e00\u4e9b\u6570\u636e\u70b9\u7f3a\u5931\u3002\u6211\u4eec\u7684\u76ee\u6807\u662f\u6e05\u7406\u6570\u636e\u96c6\uff0c\u4ee5\u4fbf\u8fdb\u884c\u540e\u7eed\u7684\u91d1\u878d\u5206\u6790\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import numpy as np<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u6a21\u62df\u7684\u80a1\u7968\u4ef7\u683c\u6570\u636e\u96c6<\/strong><\/h2>\n<p>dates = pd.date_range(&#39;2023-01-01&#39;, periods=10)<\/p>\n<p>data = {<\/p>\n<p>    &#39;Stock_A&#39;: [100, 101, np.nan, 103, 104, np.nan, 106, 107, 108, 109],<\/p>\n<p>    &#39;Stock_B&#39;: [200, np.nan, 202, 203, np.nan, 205, 206, np.nan, 208, 209],<\/p>\n<p>    &#39;Stock_C&#39;: [300, 301, 302, 303, 304, 305, np.nan, 307, 308, 309]<\/p>\n<p>}<\/p>\n<p>df_stocks = pd.DataFrame(data, index=dates)<\/p>\n<h2><strong>\u67e5\u770b\u539f\u59cb\u6570\u636e<\/strong><\/h2>\n<p>print(&quot;\u539f\u59cb\u6570\u636e:&quot;)<\/p>\n<p>print(df_stocks)<\/p>\n<h2><strong>\u65b9\u6cd5\u4e00\uff1a\u5220\u9664\u7f3a\u635f\u503c<\/strong><\/h2>\n<p>df_dropped = df_stocks.dropna()<\/p>\n<p>print(&quot;\\n\u5220\u9664\u7f3a\u635f\u503c\u540e\u7684\u6570\u636e:&quot;)<\/p>\n<p>print(df_dropped)<\/p>\n<h2><strong>\u65b9\u6cd5\u4e8c\uff1a\u7528\u7ebf\u6027\u63d2\u503c\u586b\u8865\u7f3a\u635f\u503c<\/strong><\/h2>\n<p>df_interpolated = df_stocks.interpolate(method=&#39;linear&#39;)<\/p>\n<p>print(&quot;\\n\u7ebf\u6027\u63d2\u503c\u540e\u7684\u6570\u636e:&quot;)<\/p>\n<p>print(df_interpolated)<\/p>\n<h2><strong>\u65b9\u6cd5\u4e09\uff1a\u7528\u524d\u4e00\u4e2a\u503c\u586b\u8865\u7f3a\u635f\u503c<\/strong><\/h2>\n<p>df_ffill = df_stocks.fillna(method=&#39;ffill&#39;)<\/p>\n<p>print(&quot;\\n\u7528\u524d\u4e00\u4e2a\u503c\u586b\u8865\u540e\u7684\u6570\u636e:&quot;)<\/p>\n<p>print(df_ffill)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u6848\u4f8b\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u4e0d\u540c\u65b9\u6cd5\u5904\u7406\u7f3a\u635f\u503c\u540e\u7684\u6548\u679c\u3002\u7ebf\u6027\u63d2\u503c\u548c\u524d\u4e00\u4e2a\u503c\u586b\u8865\u90fd\u662f\u5e38\u89c1\u7684\u9009\u62e9\uff0c\u6839\u636e\u5177\u4f53\u7684\u6570\u636e\u7279\u70b9\u548c\u5206\u6790\u9700\u6c42\uff0c\u53ef\u4ee5\u7075\u6d3b\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u5904\u7406\u7f3a\u635f\u503c\u662f\u6570\u636e\u6e05\u6d17\u7684\u91cd\u8981\u6b65\u9aa4\u4e4b\u4e00\uff0c\u5728\u5b9e\u9645\u6570\u636e\u5206\u6790\u4e2d\uff0c\u9009\u62e9\u5408\u9002\u7684\u7b56\u7565\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u6570\u636e\u5206\u6790\u7684\u51c6\u786e\u6027\u548c\u53ef\u9760\u6027\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528Python\u4e2d\u7684\u7f3a\u635f\u503c\u5904\u7406\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u8bc6\u522b\u6570\u636e\u96c6\u4e2d\u7684\u7f3a\u635f\u503c\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pandas<\/code>\u5e93\u8f7b\u677e\u8bc6\u522b\u7f3a\u635f\u503c\u3002\u901a\u8fc7\u8c03\u7528<code>DataFrame.isnull()<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u751f\u6210\u4e00\u4e2a\u5e03\u5c14\u6570\u636e\u6846\uff0c\u663e\u793a\u54ea\u4e9b\u503c\u4e3a\u7f3a\u5931\u3002\u7ed3\u5408<code>DataFrame.sum()<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5feb\u901f\u7edf\u8ba1\u6bcf\u4e00\u5217\u7f3a\u5931\u503c\u7684\u6570\u91cf\uff0c\u4ece\u800c\u8bc4\u4f30\u6570\u636e\u8d28\u91cf\u3002<\/p>\n<p><strong>\u53bb\u9664\u7f3a\u635f\u503c\u7684\u6700\u4f73\u5b9e\u8df5\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u53bb\u9664\u7f3a\u635f\u503c\u65f6\uff0c\u5efa\u8bae\u6839\u636e\u7f3a\u5931\u503c\u7684\u6bd4\u4f8b\u548c\u6570\u636e\u7684\u91cd\u8981\u6027\u8fdb\u884c\u5224\u65ad\u3002\u5982\u679c\u67d0\u5217\u7f3a\u5931\u503c\u5360\u6bd4\u5f88\u9ad8\uff0c\u8003\u8651\u662f\u5426\u9700\u8981\u6574\u5217\u5220\u9664\uff1b\u5982\u679c\u7f3a\u5931\u503c\u6570\u91cf\u8f83\u5c11\uff0c\u53ef\u4ee5\u9009\u62e9\u5220\u9664\u76f8\u5e94\u7684\u884c\u3002\u4f7f\u7528<code>DataFrame.dropna()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u884c\u6216\u5217\u7684\u5220\u9664\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528\u66ff\u4ee3\u65b9\u6cd5\u586b\u8865\u7f3a\u635f\u503c\uff1f<\/strong><br \/>\u9664\u4e86\u53bb\u9664\u7f3a\u635f\u503c\uff0c\u586b\u8865\u7f3a\u5931\u503c\u4e5f\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u5904\u7406\u65b9\u6cd5\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>DataFrame.fillna()<\/code>\u65b9\u6cd5\u6765\u586b\u5145\u7f3a\u5931\u503c\u3002\u53ef\u4ee5\u9009\u62e9\u7528\u5747\u503c\u3001\u4e2d\u4f4d\u6570\u6216\u4f17\u6570\u7b49\u7edf\u8ba1\u91cf\u586b\u5145\uff0c\u6216\u8005\u6839\u636e\u5176\u4ed6\u76f8\u5173\u5217\u7684\u503c\u8fdb\u884c\u63d2\u503c\u3002\u8fd9\u79cd\u65b9\u6cd5\u5728\u4fdd\u7559\u6570\u636e\u5b8c\u6574\u6027\u7684\u540c\u65f6\uff0c\u53ef\u4ee5\u51cf\u5c11\u4fe1\u606f\u7684\u4e22\u5931\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u53bb\u9664\u7f3a\u635f\u503c\u7684\u5e38\u7528\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528Pandas\u5e93\u7684dropna()\u51fd\u6570\u5220\u9664\u5305\u542b\u7f3a\u635f\u503c\u7684\u884c\u6216\u5217\u3001\u4f7f\u7528 [&hellip;]","protected":false},"author":3,"featured_media":996642,"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\/996633"}],"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=996633"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/996633\/revisions"}],"predecessor-version":[{"id":996644,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/996633\/revisions\/996644"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/996642"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=996633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=996633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=996633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}