{"id":1265,"date":"2022-08-14T16:54:37","date_gmt":"2022-08-14T08:54:37","guid":{"rendered":"https:\/\/www.dataisfun.cn\/?p=1265"},"modified":"2022-08-20T10:11:19","modified_gmt":"2022-08-20T02:11:19","slug":"pandas%e6%97%a5%e6%9c%9f%e6%97%b6%e9%97%b4%e7%9a%84%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.dataisfun.cn\/?p=1265","title":{"rendered":"pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\">\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u7ecf\u5e38\u662f\u96be\u4ee5\u907f\u514d\u7684\uff0c\u4f46\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u6bd4\u8f83\u7279\u6b8a\uff0c\u6709\u65f6\u5019\u5904\u7406\u8d77\u6765\u633a\u9ebb\u70e6\u7684\uff0c\u56e0\u6b64\uff0c\u672c\u6587\u603b\u7ed3\u4e0b pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \uff0c\u65b9\u4fbf\u4ee5\u540e\u76f4\u63a5\u53c2\u8003\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\">\u6211\u4eec\u4ee5\u4ee3\u7801\u6f14\u793a\u7684\u65b9\u5f0f\u6765\u603b\u7ed3pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\uff0c\u8be6\u89c1Juper Notebook-<a href=\"https:\/\/www.dataisfun.cn\/wp-content\/uploads\/2022\/08\/pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406.html\" target=\"_blank\" rel=\"noreferrer noopener\">pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406<\/a>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\">\u603b\u7ed3\u800c\u8a00\uff0cpandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"has-pale-cyan-blue-background-color has-background wp-block-list\" style=\"font-size:14px\"><li>\u9700\u8981\u5c06\u76ee\u6807\u503c\u8f6c\u6210\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u65f6\uff0c\u5c31\u4f7f\u7528pandas.to_datetime()\u65b9\u6cd5<\/li><li>\u9700\u8981\u5c06\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u8f6c\u6210\u5b57\u7b26\u4e32\u7c7b\u578b\u65f6\uff0c\u5c31\u4f7f\u7528Series.dt.strftime()\u65b9\u6cd5<\/li><li>\u9700\u8981\u5bf9\u65e5\u671f\u65f6\u95f4\u505a\u63a8\u79fb\u8ba1\u7b97\u65f6\uff0c\u5c31\u7ed3\u5408\u4f7f\u7528pandas.DateOffset()\u3001Series.dt.to_period()\u3001Series.shift()\u7b49\u65b9\u6cd5<\/li><li>\u9700\u8981\u505a\u65f6\u533a\u8f6c\u6362\u65f6\uff0c\u5c31\u4f7f\u7528Series.dt.tz_convert()\u65b9\u6cd5<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\">\u4ee5\u4e0a\u5c31\u662f\u5bf9pandas\u65e5\u671f\u65f6\u95f4\u5904\u7406\u7684\u603b\u7ed3\uff0c\u540e\u7eed\u6709\u65b0\u7684\u77e5\u8bc6\u70b9\uff0c\u4f1a\u6301\u7eed\u66f4\u65b0\u8fdb\u6765\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\"><span style=\"background-image: linear-gradient(transparent 60%, rgba(252, 185, 0, 0.5) 60%)\" class=\"sme-highlighter\">\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u52a1\u5fc5\u6ce8\u660e\u51fa\u5904\u5e76\u7559\u4e0b\u539f\u6587\u94fe\u63a5\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u7ecf\u5e38\u662f\u96be\u4ee5\u907f\u514d\u7684\uff0c\u4f46\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u6bd4\u8f83\u7279\u6b8a\uff0c\u6709\u65f6\u5019\u5904\u7406\u8d77\u6765\u633a\u9ebb\u70e6\u7684\uff0c&hellip; <a href=\"https:\/\/www.dataisfun.cn\/?p=1265\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[31],"class_list":["post-1265","post","type-post","status-publish","format-standard","hentry","category-python","tag-pandas","h-entry","h-as-article"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.11 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 | pandas\u65e5\u671f\u65f6\u95f4 - \u6570\u636e\u597d\u73a9<\/title>\n<meta name=\"description\" content=\"\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u7ecf\u5e38\u662f\u96be\u4ee5\u907f\u514d\u7684\uff0c\u4f46\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u6bd4\u8f83\u7279\u6b8a\uff0c\u6709\u65f6\u5019\u5904\u7406\u8d77\u6765\u633a\u9ebb\u70e6\u7684\uff0c\u56e0\u6b64\uff0c\u672c\u6587\u603b\u7ed3\u4e0b pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \uff0c\u65b9\u4fbf\u4ee5\u540e\u76f4\u63a5\u53c2\u8003\u3002\u603b\u7ed3\u800c\u8a00\uff0c pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u70b9\uff1a\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dataisfun.cn\/?p=1265\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 | pandas\u65e5\u671f\u65f6\u95f4 - \u6570\u636e\u597d\u73a9\" \/>\n<meta property=\"og:description\" content=\"\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u7ecf\u5e38\u662f\u96be\u4ee5\u907f\u514d\u7684\uff0c\u4f46\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u6bd4\u8f83\u7279\u6b8a\uff0c\u6709\u65f6\u5019\u5904\u7406\u8d77\u6765\u633a\u9ebb\u70e6\u7684\uff0c\u56e0\u6b64\uff0c\u672c\u6587\u603b\u7ed3\u4e0b pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \uff0c\u65b9\u4fbf\u4ee5\u540e\u76f4\u63a5\u53c2\u8003\u3002\u603b\u7ed3\u800c\u8a00\uff0c pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u70b9\uff1a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dataisfun.cn\/?p=1265\" \/>\n<meta property=\"og:site_name\" content=\"\u6570\u636e\u597d\u73a9\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-14T08:54:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-20T02:11:19+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dataisfun.cn\/?p=1265\",\"url\":\"https:\/\/www.dataisfun.cn\/?p=1265\",\"name\":\"pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 | pandas\u65e5\u671f\u65f6\u95f4 - \u6570\u636e\u597d\u73a9\",\"isPartOf\":{\"@id\":\"https:\/\/www.dataisfun.cn\/#website\"},\"datePublished\":\"2022-08-14T08:54:37+00:00\",\"dateModified\":\"2022-08-20T02:11:19+00:00\",\"author\":{\"@id\":\"https:\/\/www.dataisfun.cn\/#\/schema\/person\/026bc03694bbf1608ccc639fb31c3293\"},\"description\":\"\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u7ecf\u5e38\u662f\u96be\u4ee5\u907f\u514d\u7684\uff0c\u4f46\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u6bd4\u8f83\u7279\u6b8a\uff0c\u6709\u65f6\u5019\u5904\u7406\u8d77\u6765\u633a\u9ebb\u70e6\u7684\uff0c\u56e0\u6b64\uff0c\u672c\u6587\u603b\u7ed3\u4e0b pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \uff0c\u65b9\u4fbf\u4ee5\u540e\u76f4\u63a5\u53c2\u8003\u3002\u603b\u7ed3\u800c\u8a00\uff0c pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u70b9\uff1a\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dataisfun.cn\/?p=1265#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dataisfun.cn\/?p=1265\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dataisfun.cn\/?p=1265#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.dataisfun.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dataisfun.cn\/#website\",\"url\":\"https:\/\/www.dataisfun.cn\/\",\"name\":\"\u6570\u636e\u597d\u73a9\",\"description\":\"\u6570\u4e2d\u81ea\u6709\u4e7e\u5764\uff0c\u4e8e\u4e50\u8da3\u4e2d\u53d1\u73b0\u4ef7\u503c\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dataisfun.cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dataisfun.cn\/#\/schema\/person\/026bc03694bbf1608ccc639fb31c3293\",\"name\":\"admin\",\"sameAs\":[\"http:\/\/www.dataisfun.cn\"],\"url\":\"https:\/\/www.dataisfun.cn\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 | pandas\u65e5\u671f\u65f6\u95f4 - \u6570\u636e\u597d\u73a9","description":"\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u7ecf\u5e38\u662f\u96be\u4ee5\u907f\u514d\u7684\uff0c\u4f46\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u6bd4\u8f83\u7279\u6b8a\uff0c\u6709\u65f6\u5019\u5904\u7406\u8d77\u6765\u633a\u9ebb\u70e6\u7684\uff0c\u56e0\u6b64\uff0c\u672c\u6587\u603b\u7ed3\u4e0b pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \uff0c\u65b9\u4fbf\u4ee5\u540e\u76f4\u63a5\u53c2\u8003\u3002\u603b\u7ed3\u800c\u8a00\uff0c pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u70b9\uff1a","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dataisfun.cn\/?p=1265","og_locale":"zh_CN","og_type":"article","og_title":"pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 | pandas\u65e5\u671f\u65f6\u95f4 - \u6570\u636e\u597d\u73a9","og_description":"\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u7ecf\u5e38\u662f\u96be\u4ee5\u907f\u514d\u7684\uff0c\u4f46\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u6bd4\u8f83\u7279\u6b8a\uff0c\u6709\u65f6\u5019\u5904\u7406\u8d77\u6765\u633a\u9ebb\u70e6\u7684\uff0c\u56e0\u6b64\uff0c\u672c\u6587\u603b\u7ed3\u4e0b pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \uff0c\u65b9\u4fbf\u4ee5\u540e\u76f4\u63a5\u53c2\u8003\u3002\u603b\u7ed3\u800c\u8a00\uff0c pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u70b9\uff1a","og_url":"https:\/\/www.dataisfun.cn\/?p=1265","og_site_name":"\u6570\u636e\u597d\u73a9","article_published_time":"2022-08-14T08:54:37+00:00","article_modified_time":"2022-08-20T02:11:19+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.dataisfun.cn\/?p=1265","url":"https:\/\/www.dataisfun.cn\/?p=1265","name":"pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 | pandas\u65e5\u671f\u65f6\u95f4 - \u6570\u636e\u597d\u73a9","isPartOf":{"@id":"https:\/\/www.dataisfun.cn\/#website"},"datePublished":"2022-08-14T08:54:37+00:00","dateModified":"2022-08-20T02:11:19+00:00","author":{"@id":"https:\/\/www.dataisfun.cn\/#\/schema\/person\/026bc03694bbf1608ccc639fb31c3293"},"description":"\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\uff0c\u5bf9\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406\u7ecf\u5e38\u662f\u96be\u4ee5\u907f\u514d\u7684\uff0c\u4f46\u65e5\u671f\u65f6\u95f4\u7c7b\u578b\u6bd4\u8f83\u7279\u6b8a\uff0c\u6709\u65f6\u5019\u5904\u7406\u8d77\u6765\u633a\u9ebb\u70e6\u7684\uff0c\u56e0\u6b64\uff0c\u672c\u6587\u603b\u7ed3\u4e0b pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \uff0c\u65b9\u4fbf\u4ee5\u540e\u76f4\u63a5\u53c2\u8003\u3002\u603b\u7ed3\u800c\u8a00\uff0c pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406 \u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u70b9\uff1a","breadcrumb":{"@id":"https:\/\/www.dataisfun.cn\/?p=1265#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dataisfun.cn\/?p=1265"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dataisfun.cn\/?p=1265#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.dataisfun.cn\/"},{"@type":"ListItem","position":2,"name":"pandas\u65e5\u671f\u65f6\u95f4\u7684\u5904\u7406"}]},{"@type":"WebSite","@id":"https:\/\/www.dataisfun.cn\/#website","url":"https:\/\/www.dataisfun.cn\/","name":"\u6570\u636e\u597d\u73a9","description":"\u6570\u4e2d\u81ea\u6709\u4e7e\u5764\uff0c\u4e8e\u4e50\u8da3\u4e2d\u53d1\u73b0\u4ef7\u503c","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dataisfun.cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.dataisfun.cn\/#\/schema\/person\/026bc03694bbf1608ccc639fb31c3293","name":"admin","sameAs":["http:\/\/www.dataisfun.cn"],"url":"https:\/\/www.dataisfun.cn\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=\/wp\/v2\/posts\/1265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1265"}],"version-history":[{"count":10,"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=\/wp\/v2\/posts\/1265\/revisions"}],"predecessor-version":[{"id":1276,"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=\/wp\/v2\/posts\/1265\/revisions\/1276"}],"wp:attachment":[{"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataisfun.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}