{"id":1784,"date":"2023-07-25T00:23:37","date_gmt":"2023-07-25T00:23:37","guid":{"rendered":"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/"},"modified":"2023-07-25T00:23:37","modified_gmt":"2023-07-25T00:23:37","slug":"%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9","status":"publish","type":"post","link":"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 pandas get dummies \u2013 pd.get_dummies"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u5728\u7edf\u8ba1\u5b66\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u7684\u6570\u636e\u96c6\u901a\u5e38\u5305\u542b<a href=\"https:\/\/statorials.org\/cn\/\u5206\u7c7b\u4e0e\u5b9a\u91cf\/\" target=\"_blank\" rel=\"noopener\">\u5206\u7c7b\u53d8\u91cf<\/a>\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u8fd9\u4e9b\u662f\u5e26\u6709\u540d\u79f0\u6216\u6807\u7b7e\u7684\u53d8\u91cf\u3002\u793a\u4f8b\u5305\u62ec\uff1a<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">\u5a5a\u59fb\u72b6\u51b5\uff08\u201c\u5df2\u5a5a\u201d\u3001\u201c\u5355\u8eab\u201d\u3001\u201c\u79bb\u5a5a\u201d\uff09<\/span><\/li>\n<li><span style=\"color: #000000;\">\u5438\u70df\u72b6\u51b5\uff08\u201c\u5438\u70df\u8005\u201d\u3001\u201c\u975e\u5438\u70df\u8005\u201d\uff09<\/span><\/li>\n<li><span style=\"color: #000000;\">\u773c\u775b\u989c\u8272\uff08\u201c\u84dd\u8272\u201d\u3001\u201c\u7eff\u8272\u201d\u3001\u201c\u6de1\u8910\u8272\u201d\uff09<\/span><\/li>\n<li><span style=\"color: #000000;\">\u6559\u80b2\u7a0b\u5ea6\uff08\u4f8b\u5982\u201c\u9ad8\u4e2d\u201d\u3001\u201c\u5b66\u58eb\u5b66\u4f4d\u201d\u3001\u201c\u7855\u58eb\u5b66\u4f4d\u201d\uff09<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u5728\u8c03\u6574\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\uff08\u5982<a href=\"https:\/\/statorials.org\/cn\/\u591a\u5143\u7ebf\u6027\u56de\u5f52-1\/\" target=\"_blank\" rel=\"noopener\">\u7ebf\u6027\u56de\u5f52<\/a>\u3001<a href=\"https:\/\/statorials.org\/cn\/\u903b\u8f91\u56de\u5f521\/\" target=\"_blank\" rel=\"noopener\">\u903b\u8f91\u56de\u5f52<\/a>\u3001<a href=\"https:\/\/statorials.org\/cn\/\u968f\u673a\u6f14\u4e60\/\" target=\"_blank\" rel=\"noopener\">\u968f\u673a\u68ee\u6797<\/a>\u7b49\uff09\u65f6\uff0c\u6211\u4eec\u7ecf\u5e38\u5c06\u5206\u7c7b\u53d8\u91cf\u8f6c\u6362\u4e3a<strong>\u865a\u62df\u53d8\u91cf<\/strong>\uff0c\u865a\u62df\u53d8\u91cf\u662f\u7528\u4e8e\u8868\u793a\u6570\u636e\u5206\u7c7b\u7684\u6570\u503c\u53d8\u91cf\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u4f8b\u5982\uff0c\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u5305\u542b\u5206\u7c7b\u53d8\u91cf<strong>Gender<\/strong>\u7684\u6570\u636e\u96c6\u3002\u8981\u4f7f\u7528\u8be5\u53d8\u91cf\u4f5c\u4e3a\u56de\u5f52\u6a21\u578b\u4e2d\u7684\u9884\u6d4b\u53d8\u91cf\uff0c\u9996\u5148\u9700\u8981\u5c06\u5176\u8f6c\u6362\u4e3a\u865a\u62df\u53d8\u91cf\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u8981\u521b\u5efa\u8fd9\u4e2a\u865a\u62df\u53d8\u91cf\uff0c\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u4e00\u4e2a\u503c\uff08\u201c\u7537\u6027\u201d\uff09\u6765\u4ee3\u8868 0\uff0c\u53e6\u4e00\u4e2a\u503c\uff08\u201c\u5973\u6027\u201d\uff09\u4ee3\u8868 1\uff1a<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-13941 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/mannequin2.png\" alt=\"\" width=\"540\" height=\"312\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u5982\u4f55\u5728 Pandas \u4e2d\u521b\u5efa\u865a\u62df\u53d8\u91cf<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u8981\u4e3a pandas DataFrame \u4e2d\u7684\u53d8\u91cf\u521b\u5efa\u865a\u62df\u53d8\u91cf\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<a href=\"https:\/\/pandas.pydata.org\/docs\/reference\/api\/pandas.get_dummies.html\" target=\"_blank\" rel=\"noopener\">pandas.get_dummies()<\/a>\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4f7f\u7528\u4ee5\u4e0b\u57fa\u672c\u8bed\u6cd5\uff1a<\/span><\/p>\n<p> <strong><span style=\"color: #000000;\">pandas.get_dummies(\u6570\u636e\uff0c\u524d\u7f00=\u65e0\uff0c\u5217=\u65e0\uff0cdrop_first=False)<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">\u91d1\u5b50\uff1a<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>data<\/strong> \uff1apandas DataFrame \u7684\u540d\u79f0<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>prefix<\/strong> \uff1a\u6dfb\u52a0\u5230\u65b0\u865a\u62df\u53d8\u91cf\u5217\u5f00\u5934\u7684\u5b57\u7b26\u4e32<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>columns<\/strong> \uff1a\u8981\u8f6c\u6362\u4e3a\u865a\u62df\u53d8\u91cf\u7684\u5217\u7684\u540d\u79f0<\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>drop_first<\/strong> \uff1a\u662f\u5426\u5220\u9664\u7b2c\u4e00\u4e2a\u865a\u62df\u53d8\u91cf\u5217<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u4ee5\u4e0b\u793a\u4f8b\u5c55\u793a\u4e86\u5982\u4f55\u5728\u5b9e\u8df5\u4e2d\u4f7f\u7528\u6b64\u529f\u80fd\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u793a\u4f8b 1\uff1a\u521b\u5efa\u5355\u4e2a\u865a\u62df\u53d8\u91cf<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u5047\u8bbe\u6211\u4eec\u6709\u4ee5\u4e0b pandas DataFrame\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> pandas <span style=\"color: #107d3f;\">as<\/span> pd\n\n<span style=\"color: #008080;\">#createDataFrame<\/span>\ndf = pd. <span style=\"color: #3366ff;\">DataFrame<\/span> ({' <span style=\"color: #ff0000;\">income<\/span> ': [45, 48, 54, 57, 65, 69, 78],\n                   ' <span style=\"color: #ff0000;\">age<\/span> ': [23, 25, 24, 29, 38, 36, 40],\n                   ' <span style=\"color: #ff0000;\">gender<\/span> ': ['M', 'F', 'M', 'F', 'F', 'F', 'M']})\n\n<span style=\"color: #008080;\">#view DataFrame\n<\/span>df\n\n        income age gender\n0 45 23 M\n1 48 25 F\n2 54 24 M\n3 57 29 F\n4 65 38 F\n5 69 36 F\n6 78 40 M<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<strong>pd.get_dummies()<\/strong>\u51fd\u6570\u5c06\u6027\u522b\u8f6c\u6362\u4e3a\u865a\u62df\u53d8\u91cf\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#convert gender to dummy variable<\/span>\np.d. <span style=\"color: #3366ff;\">get_dummies<\/span> (df, columns=[' <span style=\"color: #ff0000;\">gender<\/span> '], drop_first= <span style=\"color: #008000;\">True<\/span> )\n\n\tincome age gender_M\n0 45 23 1\n1 48 25 0\n2 54 24 1\n3 57 29 0\n4 65 38 0\n5 69 36 0\n6 78 40 1<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u6027\u522b\u5217\u73b0\u5728\u662f\u4e00\u4e2a\u865a\u62df\u53d8\u91cf\uff0c\u5176\u4e2d\uff1a<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">\u503c<strong>0<\/strong>\u4ee3\u8868\u201c\u5973\u6027\u201d<\/span><\/li>\n<li><span style=\"color: #000000;\">\u503c\u4e3a<strong>1<\/strong>\u4ee3\u8868\u201c\u7537\u6027\u201d<\/span><\/li>\n<\/ul>\n<h3><span style=\"color: #000000;\"><strong>\u793a\u4f8b 2\uff1a\u521b\u5efa\u591a\u4e2a\u865a\u62df\u53d8\u91cf<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u5047\u8bbe\u6211\u4eec\u6709\u4ee5\u4e0b pandas DataFrame\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> pandas <span style=\"color: #107d3f;\">as<\/span> pd\n\n<span style=\"color: #008080;\">#createDataFrame<\/span>\ndf = pd. <span style=\"color: #3366ff;\">DataFrame<\/span> ({' <span style=\"color: #ff0000;\">income<\/span> ': [45, 48, 54, 57, 65, 69, 78],\n                   ' <span style=\"color: #ff0000;\">age<\/span> ': [23, 25, 24, 29, 38, 36, 40],\n                   ' <span style=\"color: #ff0000;\">gender<\/span> ': ['M', 'F', 'M', 'F', 'F', 'F', 'M'],\n                   ' <span style=\"color: #ff0000;\">college<\/span> ': ['Y', 'N', 'N', 'N', 'Y', 'Y', 'Y']})\n\n<span style=\"color: #008080;\">#view DataFrame\n<\/span>df\n\n\tincome age gender college\n0 45 23 M Y\n1 48 25 F N\n2 54 24 M N\n3 57 29 F N\n4 65 38 F Y\n5 69 36 F Y\n6 78 40 M Y<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<strong>pd.get_dummies()<\/strong>\u51fd\u6570\u5c06\u6027\u522b\u548c\u5927\u5b66\u8f6c\u6362\u4e3a\u865a\u62df\u53d8\u91cf\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#convert gender to dummy variable<\/span>\np.d. <span style=\"color: #3366ff;\">get_dummies<\/span> (df, columns=[' <span style=\"color: #ff0000;\">gender<\/span> ', ' <span style=\"color: #ff0000;\">college<\/span> '], drop_first= <span style=\"color: #008000;\">True<\/span> )\n\n\n        income age gender_M college_Y\n0 45 23 1 1\n1 48 25 0 0\n2 54 24 1 0\n3 57 29 0 0\n4 65 38 0 1\n5 69 36 0 1\n6 78 40 1 1<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u6027\u522b\u5217\u73b0\u5728\u662f\u4e00\u4e2a\u865a\u62df\u53d8\u91cf\uff0c\u5176\u4e2d\uff1a<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">\u503c<strong>0<\/strong>\u4ee3\u8868\u201c\u5973\u6027\u201d<\/span><\/li>\n<li><span style=\"color: #000000;\">\u503c\u4e3a<strong>1<\/strong>\u4ee3\u8868\u201c\u7537\u6027\u201d<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u5927\u5b66\u5217\u73b0\u5728\u662f\u4e00\u4e2a\u865a\u62df\u53d8\u91cf\uff0c\u5176\u4e2d\uff1a<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">\u503c<strong>0<\/strong>\u4ee3\u8868\u201c\u5426\u201d\u5927\u5b66<\/span><\/li>\n<li><span style=\"color: #000000;\">\u503c<strong>1<\/strong>\u8868\u793a\u201c\u662f\u201d\u4e0a\u5927\u5b66<\/span><\/li>\n<\/ul>\n<h3><span style=\"color: #000000;\"><strong>\u5176\u4ed6\u8d44\u6e90<\/strong><\/span><\/h3>\n<p><a href=\"https:\/\/statorials.org\/cn\/\u56de\u5f52\u865a\u62df\u53d8\u91cf\/\" target=\"_blank\" rel=\"noopener\">\u5982\u4f55\u5728\u56de\u5f52\u5206\u6790\u4e2d\u4f7f\u7528\u865a\u62df\u53d8\u91cf<\/a><br \/><a href=\"https:\/\/statorials.org\/cn\/\u865a\u62df\u53d8\u91cf\u9677\u9631\/\" target=\"_blank\" rel=\"noopener\">\u4ec0\u4e48\u662f\u865a\u62df\u53d8\u91cf\u9677\u9631\uff1f<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u7edf\u8ba1\u5b66\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u7684\u6570\u636e\u96c6\u901a\u5e38\u5305\u542b\u5206\u7c7b\u53d8\u91cf\u3002 \u8fd9\u4e9b\u662f\u5e26\u6709\u540d\u79f0\u6216\u6807\u7b7e\u7684\u53d8\u91cf\u3002\u793a\u4f8b\u5305\u62ec\uff1a \u5a5a\u59fb\u72b6\u51b5\uff08\u201c\u5df2\u5a5a\u201d\u3001\u201c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1784","post","type-post","status-publish","format-standard","hentry","category-11"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u4f7f\u7528 Pandas Get Dummies - pd.get_dummies<\/title>\n<meta name=\"description\" content=\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Python \u4e2d\u7684 pandas.get_dummies() \u51fd\u6570\u5728\u6570\u636e\u96c6\u4e2d\u5feb\u901f\u521b\u5efa\u865a\u62df\u53d8\u91cf\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/cn\/\u718a\u732b\u6210\u4e3a\u6a21\u7279\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u4f7f\u7528 Pandas Get Dummies - pd.get_dummies\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Python \u4e2d\u7684 pandas.get_dummies() \u51fd\u6570\u5728\u6570\u636e\u96c6\u4e2d\u5feb\u901f\u521b\u5efa\u865a\u62df\u53d8\u91cf\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/cn\/\u718a\u732b\u6210\u4e3a\u6a21\u7279\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T00:23:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/mannequin2.png\" \/>\n<meta name=\"author\" content=\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\" \/>\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:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/\",\"url\":\"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/\",\"name\":\"\u5982\u4f55\u4f7f\u7528 Pandas Get Dummies - pd.get_dummies\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/cn\/#website\"},\"datePublished\":\"2023-07-25T00:23:37+00:00\",\"dateModified\":\"2023-07-25T00:23:37+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261\"},\"description\":\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Python \u4e2d\u7684 pandas.get_dummies() \u51fd\u6570\u5728\u6570\u636e\u96c6\u4e2d\u5feb\u901f\u521b\u5efa\u865a\u62df\u53d8\u91cf\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/statorials.org\/cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u4f7f\u7528 pandas get dummies \u2013 pd.get_dummies\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/cn\/#website\",\"url\":\"https:\/\/statorials.org\/cn\/\",\"name\":\"Statorials\",\"description\":\"\u60a8\u7684\u7edf\u8ba1\u7d20\u517b\u6307\u5357\uff01\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261\",\"name\":\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\"},\"description\":\"\u5927\u5bb6\u597d\uff0c\u6211\u662f\u672c\u6770\u660e\uff0c\u4e00\u4f4d\u9000\u4f11\u7684\u7edf\u8ba1\u5b66\u6559\u6388\uff0c\u540e\u6765\u6210\u4e3a Statorials \u7684\u70ed\u5fc3\u6559\u5e08\u3002 \u51ed\u501f\u5728\u7edf\u8ba1\u9886\u57df\u7684\u4e30\u5bcc\u7ecf\u9a8c\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u6211\u6e34\u671b\u5206\u4eab\u6211\u7684\u77e5\u8bc6\uff0c\u901a\u8fc7 Statorials \u589e\u5f3a\u5b66\u751f\u7684\u80fd\u529b\u3002\u4e86\u89e3\u66f4\u591a\",\"sameAs\":[\"https:\/\/statorials.org\/cn\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u4f7f\u7528 Pandas Get Dummies - pd.get_dummies","description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Python \u4e2d\u7684 pandas.get_dummies() \u51fd\u6570\u5728\u6570\u636e\u96c6\u4e2d\u5feb\u901f\u521b\u5efa\u865a\u62df\u53d8\u91cf\u3002","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:\/\/statorials.org\/cn\/\u718a\u732b\u6210\u4e3a\u6a21\u7279\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u4f7f\u7528 Pandas Get Dummies - pd.get_dummies","og_description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Python \u4e2d\u7684 pandas.get_dummies() \u51fd\u6570\u5728\u6570\u636e\u96c6\u4e2d\u5feb\u901f\u521b\u5efa\u865a\u62df\u53d8\u91cf\u3002","og_url":"https:\/\/statorials.org\/cn\/\u718a\u732b\u6210\u4e3a\u6a21\u7279\/","og_site_name":"Statorials","article_published_time":"2023-07-25T00:23:37+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/mannequin2.png"}],"author":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/","url":"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/","name":"\u5982\u4f55\u4f7f\u7528 Pandas Get Dummies - pd.get_dummies","isPartOf":{"@id":"https:\/\/statorials.org\/cn\/#website"},"datePublished":"2023-07-25T00:23:37+00:00","dateModified":"2023-07-25T00:23:37+00:00","author":{"@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261"},"description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Python \u4e2d\u7684 pandas.get_dummies() \u51fd\u6570\u5728\u6570\u636e\u96c6\u4e2d\u5feb\u901f\u521b\u5efa\u865a\u62df\u53d8\u91cf\u3002","breadcrumb":{"@id":"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/cn\/%e7%86%8a%e7%8c%ab%e6%88%90%e4%b8%ba%e6%a8%a1%e7%89%b9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/statorials.org\/cn\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u4f7f\u7528 pandas get dummies \u2013 pd.get_dummies"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/cn\/#website","url":"https:\/\/statorials.org\/cn\/","name":"Statorials","description":"\u60a8\u7684\u7edf\u8ba1\u7d20\u517b\u6307\u5357\uff01","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261","name":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a"},"description":"\u5927\u5bb6\u597d\uff0c\u6211\u662f\u672c\u6770\u660e\uff0c\u4e00\u4f4d\u9000\u4f11\u7684\u7edf\u8ba1\u5b66\u6559\u6388\uff0c\u540e\u6765\u6210\u4e3a Statorials \u7684\u70ed\u5fc3\u6559\u5e08\u3002 \u51ed\u501f\u5728\u7edf\u8ba1\u9886\u57df\u7684\u4e30\u5bcc\u7ecf\u9a8c\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u6211\u6e34\u671b\u5206\u4eab\u6211\u7684\u77e5\u8bc6\uff0c\u901a\u8fc7 Statorials \u589e\u5f3a\u5b66\u751f\u7684\u80fd\u529b\u3002\u4e86\u89e3\u66f4\u591a","sameAs":["https:\/\/statorials.org\/cn"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts\/1784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/comments?post=1784"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts\/1784\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/media?parent=1784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/categories?post=1784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/tags?post=1784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}