{"id":228694,"date":"2020-12-07T16:14:46","date_gmt":"2020-12-07T08:14:46","guid":{"rendered":"http:\/\/4563.org\/?p=228694"},"modified":"2020-12-07T16:14:46","modified_gmt":"2020-12-07T08:14:46","slug":"%e5%a6%82%e4%bd%95%e5%a4%84%e7%90%86-pandas-%e4%b8%ad%e7%9a%84%e7%a9%ba%e5%80%bc","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=228694","title":{"rendered":"\u5982\u4f55\u5904\u7406 Pandas \u4e2d\u7684\u7a7a\u503c?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5982\u4f55\u5904\u7406 Pandas \u4e2d\u7684\u7a7a\u503c?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fanqieipnet <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u5982\u4f55\u5904\u7406 Pandas \u4e2d\u7684\u7a7a\u503c?\u4eca\u5929\u756a\u8304\u52a0\u901f\u5c31\u6765\u8ddf\u5927\u5bb6\u63a2\u8ba8\u4e00\u4e0b\u3002<\/p>\n<p>\u3000\u3000\u53ea\u8981\u548c\u6570\u636e\u6253\u4ea4\u9053\uff0c\u5c31\u4e0d\u53ef\u80fd\u4e0d\u9762\u5bf9\u4e00\u4e2a\u4ee4\u4eba\u5934\u75bc\u7684\u95ee\u9898-\u6570\u636e\u96c6\u4e2d\u5b58\u5728\u7a7a\u503c\u3002\u7a7a\u503c\u5904\u7406\uff0c\u662f\u6570\u636e\u9884\u5904\u7406\u4e4b\u6570\u636e\u6e05\u6d17\u7684\u91cd\u8981\u5185\u5bb9\u4e4b\u4e00\u3002<\/p>\n<p>\u3000\u3000 Python \u6570\u636e\u5206\u6790\u5305 Pandas \u63d0\u4f9b\u4e86\u4e00\u4e9b\u4fbf\u5229\u7684\u51fd\u6570\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u6309\u7167\u8bbe\u60f3\u5904\u7406\u3001\u89e3\u51b3\u7a7a\u503c\u3002<\/p>\n<p>\u3000\u3000\u7a7a\u503c\u5904\u7406\u7684\u7b2c\u4e00\u62db\uff1a\u5feb\u901f\u786e\u8ba4\u6570\u636e\u96c6\u4e2d\u662f\u4e0d\u662f\u5b58\u5728\u7a7a\u503c\u3002\u6709\u4e24\u4e2a\u51fd\u6570 isnull, notnull\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u5b9a\u4f4d\u6570\u636e\u96c6\u4e2d\u6bcf\u4e2a\u5143\u7d20\u662f\u5426\u4e3a\u7a7a\u503c\u3002<\/p>\n<p>\u3000\u3000\u8bf4\u5230\u7a7a\u503c\uff0c\u5728 NumPy \u4e2d\u5b9a\u4e49\u4e3a\uff1anp.nan \uff0cPython \u4e2d\u5b9a\u4e49\u4e3a None\uff0c\u6240\u4ee5\u5927\u5bb6\u6ce8\u610f\u8fd9\u79cd\u8868\u8fbe\u65b9\u5f0f\u3002\u8fd9\u91cc\u9762\u6709\u4e00\u4e2a\u5751\uff0c\u5c31\u662f Pandas \u5bf9\u8c61\u67d0\u5217\u6216\u67d0\u884c\uff0c\u76f4\u63a5\u62ff np.nan , None \u5224\u65ad\u5143\u7d20\u662f\u5426\u4e3a\u7a7a\uff0c\u53d1\u73b0\u8fd4\u56de\u7684\u90fd\u662f False \u3002\u6ce8\u610f\uff1a\u8fd9\u6837\u505a\u662f\u4e0d\u53ef\u53d6\u7684!<\/p>\n<p>\u3000\u3000\u7b2c\u4e8c\u62db\uff0c\u5047\u8bbe\u5b58\u5728\u7a7a\u503c\uff0c\u53ef\u4ee5\u4f7f\u7528 Pandas \u4e2d\u7684 fillna \u51fd\u6570\u586b\u5145\u7a7a\u503c\uff0cfillna \u6709\u4e00\u4e2a\u5173\u952e\u53c2\u6570\uff1amethod, \u5f53\u8bbe\u7f6e method \u4e3a pad \u65f6\uff0c\u8868\u793a\u600e\u6837\u586b\u5145\u5462? \u4ece\u4e0a\u4e00\u4e2a\u6709\u6548\u6570\u636e\u4f20\u64ad\u5230\u4e0b\u4e00\u4e2a\u6709\u6548\u6570\u636e\u884c\u3002\u6b64\u5916\uff0c\u8fd8\u6709\u4e00\u4e2a\u9650\u5236\u8fde\u7eed\u7a7a\u503c\u884c\u7684\u6570\u91cf\u7684\u5173\u952e\u5b57 limit.<\/p>\n<p>\u3000\u3000\u7b2c\u4e09\u62db\uff0c\u68c0\u6d4b\u5230\u4e86\u7a7a\u503c\u6570\u636e\uff0c\u4f46\u662f\u4e0d\u60f3\u505a\u4efb\u4f55\u586b\u5145\uff0c\u800c\u662f\u4ec5\u4ec5\u60f3\u4e22\u5f03\u8fd9\u4e9b\u7a7a\u503c\u6570\u636e\uff0cPandas \u63d0\u4f9b\u4e86 dropna \u51fd\u6570\u505a\u8fd9\u4ef6\u4e8b\u60c5\u3002\u91cc\u9762\u6709\u4e24\u4e2a\u5173\u952e\u53c2\u6570\uff1aaxis, how, \u4f8b\u5982\u7ec4\u5408\uff1aaxis = 0\uff0chow =&#8217;any&#8217;\uff0c\u8868\u793a\u67d0\u884c\u53ea\u8981\u67d0\u4e2a\u5143\u7d20\u4e3a\u7a7a\u503c\uff0c\u5c31\u4e22\u5f03\u3002<\/p>\n<p>\u3000\u3000\u4ee5\u4e0a\u5c31\u662f Pandas \u4e2d\uff0c\u7a7a\u503c\u5904\u7406\u7684\u57fa\u672c\u601d\u8def\u3002      <\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5904\u7406 Pandas \u4e2d\u7684\u7a7a\u503c?&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/228694"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=228694"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/228694\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=228694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=228694"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=228694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}