{"id":5667,"date":"2020-06-09T18:33:37","date_gmt":"2020-06-09T10:33:37","guid":{"rendered":"https:\/\/vip.fxxkpython.com\/?p=5667"},"modified":"2020-06-09T18:35:17","modified_gmt":"2020-06-09T10:35:17","slug":"python-%e6%95%b0%e6%8d%ae%e5%8f%af%e8%a7%86%e5%8c%96-13-%e4%bd%bf%e7%94%a8-seaborn-%e5%8f%af%e8%a7%86%e5%8c%96%e5%85%a8%e7%90%83%e7%9a%84%e7%96%ab%e6%83%85%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/vip.fxxkpython.com\/?p=5667","title":{"rendered":"Python \u6570\u636e\u53ef\u89c6\u5316 13 | \u4f7f\u7528 Seaborn \u53ef\u89c6\u5316\u5168\u7403\u7684\u75ab\u60c5\u6570\u636e"},"content":{"rendered":"\n<p>2020 \u5e74\u7684\u4e00\u573a\u75ab\u60c5\uff0c\u6539\u53d8\u4e86\u592a\u591a\u4e8b\u60c5\uff0c\u6211\u4eec\u4e5f\u6539\u53d8\u4e86\u8bb8\u591a\u770b\u6cd5\uff0c\u4e5f\u63d0\u9192\u4e86\u6211\u4eec\u9700\u8981\u591a\u73cd\u60dc\u773c\u524d\u62e5\u6709\u7684\u4e1c\u897f\u3002<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u4f7f\u7528 Seaborn \u6765\u53ef\u89c6\u5316\u4e00\u4e0b\u76ee\u524d\u7684\u75ab\u60c5\u6570\u636e\uff0c\u4e86\u89e3\u4e00\u4e0b\u73b0\u5728\u5168\u7403\u7684\u75ab\u60c5\u600e\u4e48\u6837\u4e86\u3002<\/p>\n\n\n\n<h2>\u83b7\u53d6\u75ab\u60c5\u6570\u636e<\/h2>\n\n\n\n<p>GitHub \u6709\u4e00\u4e2a\u4ed3\u5e93\uff0c\u53ef\u4ee5\u83b7\u53d6\u5230\u6700\u65b0\u7684\u75ab\u60c5\u6570\u636e\uff0c\u5728 <a href=\"https:\/\/github.com\/BlankerL\/DXY-COVID-19-Data\/raw\/master\/csv\/DXYOverall.csv\">\u8fd9\u91cc&nbsp;<\/a>\u53ef\u4ee5\u83b7\u53d6\u5230\u75ab\u60c5\u7684\u6700\u65b0\u6570\u636e\uff0c\u6570\u636e\u6765\u6e90\u4e8e\u4e01\u9999\u533b\u751f\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 pandas \u7684 read_csv \u6765\u901a\u8fc7\u94fe\u63a5\u83b7\u53d6 csv \u4e2d\u7684\u6570\u636e\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>pd.read_csv(url<strong>)<\/strong><\/p><\/blockquote>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"763\" height=\"42\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-16-26-05.png\" alt=\"\" class=\"wp-image-5668\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-16-26-05.png 763w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-16-26-05-300x17.png 300w\" sizes=\"(max-width: 763px) 100vw, 763px\" \/><\/figure><\/div>\n\n\n\n<p>\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f7d\u6587\u4ef6\u5230\u672c\u5730\u8bfb\u53d6\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"319\" height=\"37\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-16-56-30.png\" alt=\"\" class=\"wp-image-5669\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-16-56-30.png 319w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-16-56-30-300x35.png 300w\" sizes=\"(max-width: 319px) 100vw, 319px\" \/><\/figure><\/div>\n\n\n\n<p>\u83b7\u53d6\u5730\u533a\u7684\u6570\u636e\uff0c\u5f97\u5230\u7684 DataFrame \u662f\u8fd9\u6837\u7684\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"991\" height=\"633\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-17-01-32.png\" alt=\"\" class=\"wp-image-5670\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-17-01-32.png 991w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-17-01-32-300x192.png 300w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-17-01-32-768x491.png 768w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-17-01-32-769x491.png 769w\" sizes=\"(max-width: 991px) 100vw, 991px\" \/><\/figure><\/div>\n\n\n\n<p>\u8fd9\u91cc\u6709\u4ece\u6d32\u5230\u56fd\u5bb6\u5230\u5177\u4f53\u7701\u7684\u8be6\u60c5\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u5f53\u7136\uff0c\u4e5f\u63d0\u4f9b\u4e86<a href=\"https:\/\/lab.isaaclin.cn\/nCoV\/generator#\/default\/area_nCoV_api_area_get\">\u75ab\u60c5\u6570\u636e\u63a5\u53e3<\/a>\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 requests \u7684 get \u8bf7\u6c42\u76f8\u5173\u7684\u6570\u636e\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"416\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-20-08-1024x416.png\" alt=\"\" class=\"wp-image-5671\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-20-08-1024x416.png 1024w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-20-08-300x122.png 300w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-20-08-768x312.png 768w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-20-08-769x312.png 769w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-20-08.png 1093w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\u77e5\u9053\u4e86\u5982\u4f55\u83b7\u53d6\u6570\u636e\u4e4b\u540e\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u9010\u4e2a\u5206\u6790\uff1a<\/p>\n\n\n\n<h2>\u53ef\u89c6\u5316\u75ab\u60c5\u6570\u636e<\/h2>\n\n\n\n<p>\u83b7\u53d6\u5168\u7403\u7684\u75ab\u60c5\u6570\u636e\uff0c\u7136\u540e\u4f7f\u7528 pandas \u8f6c\u5316\u4e3a DataFrame\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"555\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-42-44-1024x555.png\" alt=\"\" class=\"wp-image-5673\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-42-44-1024x555.png 1024w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-42-44-300x162.png 300w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-42-44-768x416.png 768w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-42-44-769x416.png 769w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-22-42-44.png 1058w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<h3>\u6570\u636e\u6e05\u6d17<\/h3>\n\n\n\n<h4>\u683c\u5f0f\u5316\u65f6\u95f4<\/h4>\n\n\n\n<p>\u53ef\u4ee5\u770b\u5230\u8fd9\u91cc\u7684\u6570\u636e\u6709\u70b9\u95ee\u9898\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"99\" height=\"335\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-23-28-56.png\" alt=\"\" class=\"wp-image-5674\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-23-28-56.png 99w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-07-23-28-56-89x300.png 89w\" sizes=\"(max-width: 99px) 100vw, 99px\" \/><\/figure><\/div>\n\n\n\n<p>\u6211\u4eec\u5c06\u65f6\u95f4\u6233\u8f6c\u5316\u4e3a\u6807\u51c6\u7684\u65f6\u95f4\u683c\u5f0f\uff0c\u6ce8\u610f\u8fd9\u91cc\u7684\u5355\u4f4d\u5e94\u8be5\u662f ms\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"693\" height=\"46\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-14-37.png\" alt=\"\" class=\"wp-image-5677\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-14-37.png 693w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-14-37-300x20.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/figure><\/div>\n\n\n\n<p> \u5f97\u5230\u7684\u65f6\u95f4\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"69\" height=\"428\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-14-55.png\" alt=\"\" class=\"wp-image-5678\"\/><\/figure><\/div>\n\n\n\n<p>\u53ef\u4ee5\u901a\u8fc7 info \u6765\u67e5\u770b DataFrame \u7684\u4fe1\u606f\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"525\" height=\"406\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-15-37.png\" alt=\"\" class=\"wp-image-5679\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-15-37.png 525w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-15-37-300x232.png 300w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/figure><\/div>\n\n\n\n<h4>\u6570\u636e\u53bb\u91cd<\/h4>\n\n\n\n<p>\u6709\u4e00\u4e9b\u56fd\u5bb6\u6570\u636e\u91cd\u590d\u4e86\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 drop_duplicates \u6765\u53bb\u91cd\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"728\" height=\"409\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-16-45.png\" alt=\"\" class=\"wp-image-5680\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-16-45.png 728w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-16-45-300x169.png 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" \/><\/figure><\/div>\n\n\n\n<h4>\u6570\u636e\u5206\u7ec4<\/h4>\n\n\n\n<p>\u63a5\u7740\u6211\u4eec\u5bf9\u4e0d\u540c\u7684\u6d32\u8fdb\u884c\u6570\u636e\u5206\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528 groupby \u65b9\u6cd5\uff0c\u5c06\u5f97\u5230\u7684\u6570\u636e\u6c42\u548c\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"683\" height=\"297\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-18-22.png\" alt=\"\" class=\"wp-image-5681\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-18-22.png 683w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-18-22-300x130.png 300w\" sizes=\"(max-width: 683px) 100vw, 683px\" \/><\/figure><\/div>\n\n\n\n<p>\u53bb\u9664\u4e0d\u5fc5\u8981\u7684\u5217\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"645\" height=\"287\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-19-14.png\" alt=\"\" class=\"wp-image-5682\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-19-14.png 645w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-19-14-300x133.png 300w\" sizes=\"(max-width: 645px) 100vw, 645px\" \/><\/figure><\/div>\n\n\n\n<h4>\u53ef\u89c6\u5316\u786e\u8bca\u6570\u91cf<\/h4>\n\n\n\n<p>\u63a5\u7740\u6211\u4eec\u4f7f\u7528 Seaborn \u6765\u6839\u636e\u786e\u8bca\u6570\u91cf\u8fdb\u884c\u53ef\u89c6\u5316\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"910\" height=\"406\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-20-13.png\" alt=\"\" class=\"wp-image-5683\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-20-13.png 910w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-20-13-300x134.png 300w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-20-13-768x343.png 768w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-20-13-769x343.png 769w\" sizes=\"(max-width: 910px) 100vw, 910px\" \/><\/figure><\/div>\n\n\n\n<p>\u8fd9\u91cc\u7684\u5b57\u4f53\u6211\u7528\u7684\u662f\u7cfb\u7edf\u81ea\u5e26\u7684\uff1aAR PL UKai CN\uff0c\u4e3a\u4e86\u907f\u514d<div style=\"text-align:center;border:1px dashed #FF9A9A;padding:8px;margin:10px auto;color:#FF6666;\">\u672c\u6587\u9690\u85cf\u5185\u5bb9 <a href=\"https:\/\/vip.fxxkpython.com\/wp-login.php?redirect_to=https%3A%2F%2Fvip.fxxkpython.com%2F%3Fp%3D5667\">\u767b\u9646<\/a> \u540e\u624d\u53ef\u4ee5\u6d4f\u89c8<\/div><\/p><\/blockquote>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"563\" height=\"426\" src=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-28-44.png\" alt=\"\" class=\"wp-image-5688\" srcset=\"https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-28-44.png 563w, https:\/\/vip.fxxkpython.com\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-09-18-28-44-300x227.png 300w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/figure><\/div>\n\n\n\n<p>\u5173\u4e8e\u75ab\u60c5\u6570\u636e\u8fd8\u6709\u4e00\u4e9b\u53ef\u89c6\u5316\u7684\u5730\u65b9\uff0c\u6bd4\u5982\u5730\u56fe\u76f8\u5173\u53ef\u89c6\u5316\uff0c\u4f1a\u5728\u4e0b\u7bc7\u4f7f\u7528 pyecharts \u53ef\u89c6\u5316\u6570\u636e\u7684\u65f6\u5019\u8fdb\u4e00\u6b65\u4ecb\u7ecd\uff0c\u4e0a\u9762\u7684\u4ee3\u7801\u5df2\u7ecf\u4e0a\u4f20\u5230 Github \u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2020 \u5e74\u7684\u4e00\u573a\u75ab\u60c5\uff0c\u6539\u53d8\u4e86\u592a\u591a\u4e8b\u60c5\uff0c\u6211\u4eec\u4e5f\u6539\u53d8\u4e86\u8bb8\u591a\u770b\u6cd5\uff0c\u4e5f\u63d0\u9192\u4e86\u6211\u4eec\u9700\u8981\u591a\u73cd\u60dc\u773c\u524d\u62e5\u6709\u7684\u4e1c\u897f\u3002 \u63a5\u4e0b\u6765\u6211\u4eec\u6765\u4f7f\u7528 Seaborn \u6765\u53ef\u89c6\u5316\u4e00\u4e0b\u76ee\u524d\u7684\u75ab\u60c5\u6570\u636e\uff0c\u4e86\u89e3\u4e00\u4e0b\u73b0\u5728\u5168\u7403\u7684\u75ab\u60c5\u600e\u4e48\u6837\u4e86\u3002 \u83b7\u53d6\u75ab\u60c5\u6570\u636e GitHub \u6709\u4e00\u4e2a\u4ed3\u5e93\uff0c\u53ef\u4ee5\u83b7\u53d6\u5230\u6700&hellip;<\/p>\n","protected":false},"author":1,"featured_media":5687,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[393],"tags":[461,459,463,462,460],"_links":{"self":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/5667"}],"collection":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5667"}],"version-history":[{"count":3,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/5667\/revisions"}],"predecessor-version":[{"id":5690,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/posts\/5667\/revisions\/5690"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=\/wp\/v2\/media\/5687"}],"wp:attachment":[{"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vip.fxxkpython.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}