{"id":329920,"date":"2021-02-08T05:10:37","date_gmt":"2021-02-07T21:10:37","guid":{"rendered":"http:\/\/4563.org\/?p=329920"},"modified":"2021-02-08T05:10:37","modified_gmt":"2021-02-07T21:10:37","slug":"python-%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84%e5%86%85%e5%ad%98%e5%8d%a0%e7%94%a8%e6%98%af%e5%8e%9f%e5%a7%8b%e6%95%b0%e6%8d%ae%e7%9a%84-5-%e5%80%8d%e5%b7%a6%e5%8f%b3","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=329920","title":{"rendered":"Python \u6570\u636e\u7ed3\u6784\u5185\u5b58\u5360\u7528\u662f\u539f\u59cb\u6570\u636e\u7684 5 \u500d\u5de6\u53f3"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Python \u6570\u636e\u7ed3\u6784\u5185\u5b58\u5360\u7528\u662f\u539f\u59cb\u6570\u636e\u7684 5 \u500d\u5de6\u53f3               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wohenfuyou <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5927\u6982\u662f\u5982\u4e0b\u7ed3\u6784\u4f53<br \/> [{dic1&#8230;.},{key1:[value1,value2&#8230;],key2:[value1,value2&#8230;]},{dic3},{dic4}]<\/p>\n<p>1.5g \u6570\u636e\u8981 7g \u591a\u5185\u5b58\uff0c\u8bf7\u95ee\u8fd9\u662f\u6b63\u5e38\u7684\u5185\u5b58\u5360\u7528\u4e48\uff0c\u8981\u662f\u4f18\u5316\u7684\u8bdd\u5728\u54ea\u65b9\u9762\u4f18\u5316\u5462\uff0c\u8bf7\u6559\u5404\u4f4d~<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>12<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5232407\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : linksNoFound <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e70\u5185\u5b58                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232408\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lkytal <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u7528 Python (\u96fe                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232409\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : est <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u822c\u662f\u7528 __slots__ \u7f13\u89e3\u3002\u4e0d\u8fc7\u4f60\u9047\u5230\u5185\u5b58\u95ee\u9898\u5efa\u8bae numpy \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232410\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : iqxd <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5927\u91cf\u5c0f\u6570\u636e\u5982\u679c\u7ea0\u7ed3\u5185\u5b58\u5c31\u4e0d\u8981\u7528\u901a\u7528\u6570\u636e\u7ed3\u6784\u3002<br \/>\u4e3a\u4e86\u8bfb\u53d6\u548c\u63d2\u5165\u6548\u7387\uff0cpython \u7684 dict \u7684\u9ed8\u8ba4\u5206\u914d\u952e\u503c\u7a7a\u95f4\u4e0e\u5b9e\u9645\u952e\u503c\u6570\u91cf\u5927\u6982\u662f 3:1.<br \/>\u5bf9\u4e8e python \u8fd8\u7b97\u6b63\u5e38\uff0c\u5373\u4f7f\u662f C \u7684\u53cc\u5411\u94fe\u8868\uff0c\u7528 64 \u4f4d\u6307\u9488\u6709\u65f6\u5019\u5360\u7528\u5185\u5b58\u90fd\u53ef\u80fd\u662f\u5b9e\u9645\u6570\u636e\u7684 3 \u500d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232411\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ebingtel <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7eaf\u7cb9\u904d\u5386\u7684\u8bdd \u7528\u751f\u6210\u5668 \u522b\u7528 list                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232412\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gjquoiai <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             pandas \u89e3\u541b\u6101                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232413\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tmackan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             py \u4e5f\u6709\u57fa\u7840\u7c7b\u578b\u7684\uff0c\u9664\u4e86 list\uff0ctuple\uff0cdict \u4ee5\u540e\uff0c\u4e5f\u652f\u6301\u7279\u5b9a\u7c7b\u578b\u7684\u7c7b\u578b\uff0c\u53ef\u4ee5\u770b\u4e0b\uff0c\u6bd4\u5982\u53ea\u652f\u6301 int \u7684 list                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232414\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tmackan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @tmackan \u7ea0\u6b63\u4e0b from array import array \u8fd9\u4e2a\u6570\u7ec4\uff0c\u53ea\u80fd\u6307\u5b9a\u7279\u5b9a\u7c7b\u578b\u7684\u6570\u7ec4<\/p>\n<p>A Python array is as lean as a C array. When creating an array, you provide a typecode, a letter to determine the underlying C type used to store each item in the array. For example, b is the typecode for signed char. If you create an array(&#8216;b&#8217;), then each item will be stored in a single byte and interpreted as an integer from \u2013128 to 127. For large sequences of numbers, this saves a lot of memory. And Python will not let you put any number that does not match the type for the array.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232415\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vance123 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u867d\u7136 Python \u63d0\u4f9b\u4e86\u6bd4 C \u66f4\u591a\u7684\u529f\u80fd, \u4f46\u8fd9\u662f\u4ee5\u65f6\u95f4\u548c\u7a7a\u95f4\u4e3a\u4ee3\u4ef7\u7684. \u4ee5 str \u4e3a\u4f8b, \u5355\u4e2a\u5bf9\u8c61\u8d77\u6b65\u5c31\u662f\u51e0\u5341 Byte \u7684 metadata, \u5b57\u7b26\u4e32\u4e2d\u53ea\u8981\u6709\u4e00\u4e2a\u4e2d\u6587\u5b57\u7b26, \u5176\u5185\u5b58\u5360\u7528\u90fd\u4f1a\u6bd4\u7eaf ascii \u591a\u4e0a 3 \u500d.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232416\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lysS <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             py \u53c8\u4e0d\u662f C\uff0c\u662f\u8fd9\u6837\u7684\uff0c\u6211\u8bb0\u5f97 PHP \u7684\u6570\u7ec4\u5360\u7528\u5927\u5c0f\u4e5f\u662f\u5b9e\u9645\u5927\u5c0f\u7684 4 \u500d\u5de6\u53f3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232417\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : littleMaple <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u89c9\u662f\u4e2a XY \u95ee\u9898\uff0c\u9898\u4e3b\u5982\u679c\u53ef\u4ee5\u7ed9\u51fa\u66f4\u591a\u4e0a\u4e0b\u6587\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u89e3\u51b3\u3002<\/p>\n<p>\u5982\u679c\u662f homogeneous data structure\uff0c\u53ef\u4ee5\u7528\u4e0a\u8bf4\u7684 numpy\uff0cpandas\uff0carray \u7b49\u5e93\u3002<\/p>\n<p>\u53e6\u5916\u53ef\u4ee5\u8003\u8651\u8f6c\u6362\u6210\u6570\u636e\u5e93\u6570\u636e\uff0c\u9700\u8981\u8bbf\u95ee\u6570\u636e\u65f6\u518d\u548c\u6570\u636e\u5e93\u8fdb\u884c\u4ea4\u4e92\uff0c\u5c31\u4e0d\u5fc5\u628a\u6240\u6709\u6570\u636e\u90fd\u4e00\u4e0b\u5b50\u6324\u8fdb\u5185\u5b58\u4e2d\u3002\u987a\u5e26\u4e00\u63d0 Python \u6709\u539f\u751f\u81ea\u5e26\u6570\u636e\u5e93\u4ea4\u4e92\u5e93\u53eb\u505a sqlite3.<\/p>\n<p>\u770b\u4f60\u5217\u51fa\u7684\u6570\u636e\u7684\u683c\u5f0f\uff0c\u4f3c\u4e4e\u50cf\u662f JSON\uff0c\u53ef\u4ee5\u7528\u4e00\u4e9b lazy-parse json \u7684\u5e93\uff0c\u4f8b\u5982 ijson ( https:\/\/pypi.org\/project\/ijson\/), json-streamer ( https:\/\/github.com\/kashifrazzaqui\/json-streamer), bigjson ( https:\/\/github.com\/henu\/bigjson), jsonslicer ( https:\/\/pypi.org\/project\/jsonslicer\/).<\/p>\n<p>\u5982\u679c\u5bf9\u7cbe\u5ea6\u8981\u6c42\u4e0d\u9ad8\uff0c\u53ef\u4ee5\u7528\u4e00\u4e9b succinct data structure \u6765\u5927\u5927\u7b80\u5316\u6570\u636e\u7ed3\u6784\u7a7a\u95f4\u5f00\u9500\uff0c\u4f8b\u5982\u5e03\u9686\u8fc7\u6ee4\u5668\uff0cHyperLogLog\uff0cCount-Min sketch \u7b49\u3002<\/p>\n<p>\u5173\u4e8e\u6570\u636e\u7a7a\u95f4\u5360\u7528\u7684\u4f18\u5316\uff0c\u53ef\u4ee5\u770b\u7ecf\u5178\u7684\u300a Python \u9ad8\u6027\u80fd\u7f16\u7a0b\u300b\uff0c\u91cc\u9762\u9664\u4e86\u8bb2 Python \u4ee3\u7801\u5982\u4f55\u63d0\u5347\u65f6\u95f4\u6027\u80fd\uff0c\u8fd8\u8bb2\u4e86 Python \u4ee3\u7801\u5982\u4f55\u63d0\u5347\u7a7a\u95f4\u6027\u80fd\uff0c\u8bb2\u7684\u975e\u5e38\u5168\u9762\u7ec6\u81f4\uff0c\u5927\u90e8\u5206\u53ef\u7528\u7684\u9009\u9879\u90fd\u8986\u76d6\u4e86.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5232418\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hotea <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6570\u636e\u6709\u91cd\u590d\u503c\u7684\u8bdd categorical \u53ef\u4ee5\u7701\u4e00\u70b9\u5185\u5b58<br \/>https:\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/categorical.html                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Python \u6570\u636e\u7ed3\u6784\u5185\u5b58\u5360\u7528\u662f\u539f&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\/329920"}],"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=329920"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/329920\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=329920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=329920"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=329920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}