{"id":85149,"date":"2020-03-28T12:13:34","date_gmt":"2020-03-28T04:13:34","guid":{"rendered":"http:\/\/4563.org\/?p=85149"},"modified":"2020-03-28T12:13:34","modified_gmt":"2020-03-28T04:13:34","slug":"%e5%86%99%e4%ba%86%e4%b8%80%e4%b8%aa%e4%bc%98%e5%8c%96-pandas-%e5%86%85%e5%ad%98%e7%9a%84%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=85149","title":{"rendered":"\u5199\u4e86\u4e00\u4e2a\u4f18\u5316 pandas \u5185\u5b58\u7684\u5de5\u5177"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5199\u4e86\u4e00\u4e2a\u4f18\u5316 pandas \u5185\u5b58\u7684\u5de5\u5177               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YUX <\/span>  <span><i><\/i> 13<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>pandas \u7206\u5185\u5b58\u4e3b\u8981\u662f\u4e24\u4e2a\u539f\u56e0<\/p>\n<ul>\n<li>\u9ed8\u8ba4 int64, float64<\/li>\n<li>object \u7c7b\u578b\u7ecf\u5e38\u6709\u592a\u591a\u91cd\u590d\u9879<\/li>\n<\/ul>\n<p>\u9488\u5bf9\u8fd9\u4e24\u70b9\u90fd\u505a\u4e86\u4f18\u5316, int \u3001float \u8f6c\u5316\u4e3a\u5408\u9002\u90fd\u7c7b\u578b, object \u5982\u679c\u91cd\u590d\u9879\u592a\u591a\u5c31\u8f6c\u5316\u4e3a category<\/p>\n<p>\u7528\u6cd5\u5f88\u7b80\u5355<\/p>\n<pre><code>import fast_csv as fc data = fc.read_csv('$PATH\/$FILE.csv') <\/code><\/pre>\n<p>\u4e00\u822c\u6765\u8bb2 (\u6211\u6700\u8fd1\u7528\u7684\u51e0\u4e2a kaggle \u7684 data),\u80fd\u51cf\u5c11 50%\u5185\u5b58,\u6709\u65f6\u80fd\u51cf\u5c11 90%\u4ee5\u4e0a. \u6ca1\u6709\u4ec0\u4e48\u526f\u4f5c\u7528,\u548c\u4e00\u822c\u76f4\u63a5\u7528<code>pandas<\/code>\u8bfb csv \u662f\u4e00\u6837\u7684,\u90fd\u662f <code>pandas.DataFrame<\/code><\/p>\n<p>\u5f00\u6e90\u5728 https:\/\/github.com\/YUX-IO\/fast_csv<\/p>\n<p>\u5b89\u88c5 <code>pip install fast_csv<\/code><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200516_5ebfb78b5daa4.jpg\" alt=\"\u5199\u4e86\u4e00\u4e2a\u4f18\u5316 pandas \u5185\u5b58\u7684\u5de5\u5177\" \/><\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1401484\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lithiumii <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             kaggle                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1401485\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nzd <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u6709\u70b9\u5389\u5bb3\uff0c\u5b66\u4e60\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1401486\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dlsflh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7b49\u6211\u4e0a\u73ed\u540e\u5c31\u5b9e\u6d4b\u5bf9\u5927\u91cf\u7684\u5de5\u4e1a\u4f20\u611f\u5668\u6570\u636e\u7684\u4f18\u5316\u6548\u679c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1401487\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ipwx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u3002\u3002\u3002\u4f60\u9700\u8981\u7684\u662f\u5728\u8c03\u7528 pd.read_csv \u7684\u65f6\u5019\u624b\u52a8\u6307\u5b9a dtype={&#8230;}\uff0c\u7136\u540e engine=&#8217;C&#8217;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5199\u4e86\u4e00\u4e2a\u4f18\u5316 pandas \u5185\u5b58\u7684&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\/85149"}],"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=85149"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/85149\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85149"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}