{"id":6588,"date":"2024-09-26T02:04:20","date_gmt":"2024-09-25T18:04:20","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=6588"},"modified":"2024-09-26T02:04:20","modified_gmt":"2024-09-25T18:04:20","slug":"excel-zhongde-python","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/ja\/excel-zhongde-python\/","title":{"rendered":"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237"},"content":{"rendered":"<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237\u3002\u53bb\u5e74 8 \u6708\uff0c\u5fae\u8f6f\u4e0e Anaconda \u5408\u4f5c\uff0c\u901a\u8fc7\u96c6\u6210 Python \u4e3a Excel \u5f15\u5165\u4e86\u4e00\u4e2a\u4ee4\u4eba\u5174\u594b\u7684\u65b0\u589e\u529f\u80fd\uff0c\u4ece\u800c\u53ef\u4ee5\u5c06 Python \u548c Excel \u5206\u6790\u65e0\u7f1d\u7ed3\u5408\u5230\u540c\u4e00\u4e2a\u5de5\u4f5c\u7c3f\u4e2d\uff0c\u65e0\u9700\u8bbe\u7f6e\u3002\u4ece\u90a3\u65f6\u8d77\uff0c\u6211\u4eec\u5c06\u6d41\u884c\u7684 Python \u5206\u6790\u5e93\uff08\u5982 pandas\u3001Matplotlib \u548c NLTK\uff09\u7684\u5f3a\u5927\u529f\u80fd\u5e26\u7ed9\u4e86\u65e0\u6570\u7684 Excel \u7528\u6237\u3002<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u5f53\u7136\uff0c\u8981\u4f7f\u7528Python in Excel\uff0c\u5fc5\u987b\u8ba2\u9605Microsoft 365 \u5546\u4e1a\u7248\u6216\u4f01\u4e1a\u7248\u3002<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u6253\u5f00Excel\uff0c\u70b9\u51fb\u201c\u516c\u5f0f\u201d-\u201c\u63d2\u5165Python\u201d\uff1a<\/p>\n<\/div>\n<div class=\"el-embed-image el-p\" data-is-embed=\"true\" data-embed-type=\"image\" data-tag-name=\"p\">\n<p dir=\"auto\"><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/5601aecf737600d.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/><\/p>\n<p dir=\"auto\">\u9009\u4e2d\u5355\u5143\u683c\uff0c\u8f93\u5165\u201c=PY\u201d\uff1a<\/p>\n<\/div>\n<div class=\"el-embed-image el-p\" data-is-embed=\"true\" data-embed-type=\"image\" data-tag-name=\"p\">\n<p dir=\"auto\"><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/885e0086b2bafc8.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/><\/p>\n<p dir=\"auto\">\u70b9\u51fb\u5f39\u51fa\u7684PY\u6309\u94ae\u540e\uff0c\u8f93\u5165\u6846\u53d8\u6210\u7eff\u8272\u7684\u201cPY\u201d\uff1a<\/p>\n<\/div>\n<div class=\"el-embed-image el-p\" data-is-embed=\"true\" data-embed-type=\"image\" data-tag-name=\"p\">\n<p dir=\"auto\"><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/c28c3c43e171457.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/><\/p>\n<p dir=\"auto\">\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u53ef\u4ee5\u5bf9\u6570\u636e\u8fdb\u884cPython\u5904\u7406\u5206\u6790\u4e86\u3002<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u6211\u4eec\u6709\u5982\u4e0b\u6570\u636e\uff1a<\/p>\n<\/div>\n<div class=\"el-embed-image el-p\" data-is-embed=\"true\" data-embed-type=\"image\" data-tag-name=\"p\">\n<p dir=\"auto\"><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/04e9e2d3057a2e8.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/><\/p>\n<p dir=\"auto\">\u6b64\u65f6\uff0c\u6709\u4e24\u79cd\u60c5\u51b5\u53d1\u751f\uff1a\u4e00\u79cd\u662f\u60a8\u4f1aPython\u8bed\u8a00\uff0c\u53e6\u4e00\u79cd\u662f\u60a8\u4e0d\u4f1aPython\u8bed\u8a00\u3002<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\"><strong>\u5982\u679c\u60a8\u4f1a\u4f7f\u7528Python\u8bed\u8a00<br \/>\n<\/strong><\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u5728PY\u8f93\u5165\u6846\u8f93\u5165\uff1a<\/p>\n<\/div>\n<div class=\"el-pre\" data-tag-name=\"pre\">\n<pre><code>sample_df = xl(\"IrisDataSet8[#\u5168\u90e8]\", headers=True)\r\nsample_df.describe()\r\n<\/code><\/pre>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u751f\u6210dataframe\uff0c\u5c55\u5f00\u63cf\u8ff0\u4fe1\u606f\uff1a<\/p>\n<\/div>\n<div class=\"el-embed-image el-p\" data-is-embed=\"true\" data-embed-type=\"image\" data-tag-name=\"p\">\n<p dir=\"auto\"><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/3482ce29cb3aebf.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/>\u63a5\u7740\uff0c\u518d\u5bfc\u5165matplotlib\u5e93\u751f\u6210\u6563\u70b9\u56fe\uff1a<\/p>\n<\/div>\n<div class=\"el-pre\" data-tag-name=\"pre\">\n<pre><code>import matplotlib.pyplot as plt\r\nplt.scatter(xl(\"IrisDataSet10[sepal_length]\"), xl(\"IrisDataSet10[sepal_width]\"))\r\nplt.xlabel('sepal_length')\r\nplt.ylabel('sepal_width')\r\nplt.title('Sepal length and width analysis')\r\n<\/code><\/pre>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u751f\u6210\u56fe\u50cf\u4ee5\u89c2\u5bdf\u53d8\u91cf\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a<\/p>\n<\/div>\n<div class=\"el-embed-image el-p\" data-is-embed=\"true\" data-embed-type=\"image\" data-tag-name=\"p\">\n<p dir=\"auto\"><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/74b2bd57c38622c.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/>\u5f15\u5165seaborn\u8fdb\u884c\u7ebf\u6027\u56de\u5f52\u7edf\u8ba1\u6a21\u578b\uff1a<\/p>\n<\/div>\n<div class=\"el-pre\" data-tag-name=\"pre\">\n<pre><code>import seaborn as sns\r\nsample_df = xl(\"IrisDataSet11[#\u5168\u90e8]\", headers=True)\r\nsns.regplot(data = sample_df[[\"sepal_length\",\"petal_length\"]], x = \"sepal_length\", y = \"petal_length\")\r\n<\/code><\/pre>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u7ed8\u56fe\u627e\u51fa\u56e0\u53d8\u91cf\u4e0e\u4e00\u4e2a\u6216\u591a\u4e2a\u81ea\u53d8\u91cf\u4e4b\u95f4\u7684\u7ebf\u6027\u5173\u7cfb\uff1a<\/p>\n<\/div>\n<div class=\"el-embed-image el-p\" data-is-embed=\"true\" data-embed-type=\"image\" data-tag-name=\"p\">\n<p dir=\"auto\"><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/0ba71d4ec858733.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/>\u5f15\u5165pandas\u77e9\u9635\u56fe\uff1a<\/p>\n<\/div>\n<div class=\"el-pre\" data-tag-name=\"pre\">\n<pre><code>from pandas.plotting import scatter_matrix\r\nsample_df = xl(\"IrisDataSet13[#\u5168\u90e8]\", headers=True)\r\ncolumns_to_plot = [\"sepal_length\", \"sepal_width\", \"petal_length\", \"petal_width\"]\r\ncategories = sample_df[\"species\"].unique()  # Get unique categories\r\ncolors = {category: i for i, category in enumerate(categories)}\r\nscatter_matrix(sample_df, c=sample_df[\"species\"].apply(lambda x: colors[x]), figsize=(6, 6), alpha=0.8)\r\n<\/code><\/pre>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u751f\u6210\u56fe\u77e9\u9635\uff0c\u7528\u4e8e\u5206\u6790\u6570\u636e\u96c6\u4e2d\u53d8\u91cf\u5bf9\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\"><strong><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/f6c39d0535011a2.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/>\u5982\u679c\u60a8\u4e0d\u4f1aPython\u8bed\u8a00<br \/>\n<\/strong><\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u4e5f\u65e0\u59a8\uff0ccopilot\u4f1a\u5e2e\u52a9\u60a8\uff01<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u5728Excel\u4e2d\uff0c\u70b9\u51fbcopilot\uff0c\u5f39\u51fa\u53f3\u4fa7\u804a\u5929\u6846\uff0c\u8981\u6c42copilot\u5199\u51faPython\u8fdb\u884c\u7ebf\u6027\u56de\u5f52\u7684\u4ee3\u7801\uff1a<\/p>\n<\/div>\n<div class=\"el-embed-image el-p\" data-is-embed=\"true\" data-embed-type=\"image\" data-tag-name=\"p\">\n<p dir=\"auto\"><img decoding=\"async\" title=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/09\/484c8954293cb5c.png\" alt=\"Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237-1\" \/>\u590d\u5236\u8fd9\u4e00\u6bb5\u4ee3\u7801\u5230PY\u8f93\u5165\u6846\uff0c\u6839\u636e\u63d0\u793a\u8fdb\u884c\u9002\u5f53\u4fee\u6539\u5373\u53ef\u3002<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u5e76\u4e14\uff0c\u5f88\u5febPython in Excel with copilot\u5c31\u8981\u53ef\u4ee5\u7528\u4e86\u3002\u5c4a\u65f6\uff0ccopilot\u5c06\u76f4\u63a5\u6839\u636e\u81ea\u7136\u8bed\u8a00\u81ea\u52a8\u751f\u6210py\u4ee3\u7801\u5e76\u76f4\u63a5\u8fd0\u884c\u51fa\u7ed3\u679c\uff0c\u76f4\u63a5\u7701\u6389\u4e86\u590d\u5236\u7c98\u8d34\u4fee\u6539\u7684\u6b65\u9aa4\u3002<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u8ba9\u6211\u4eec\u671f\u5f85\u8fd9\u4e00\u5207\u7684\u53d1\u751f\uff01<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u5f88\u591a\u4eba\u8bf4\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5\u5728Python\u4e2d\u5b9e\u73b0\uff1f<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u6211\u7684\u56de\u7b54\u662f\uff1aPython\u5355\u5355\u4e00\u4e2a\u5b89\u88c5\u73af\u5883\u5c31\u628a90%\u7684\u4eba\u6321\u5728\u4e86\u95e8\u5916\uff0c\u6709\u4e9b\u4eba\u7ec8\u5176\u4e00\u751f\u90fd\u4e0d\u613f\u610f\u79bb\u5f00Excel\u7684\u3002<\/p>\n<\/div>\n<div class=\"el-p\" data-tag-name=\"p\">\n<p dir=\"auto\">\u5b9e\u73b0\u8fd9\u4e00\u5207\uff0c\u53ea\u9700\u8981\u4e00\u4e2aMicrosoft 365\u5546\u4e1a\u8ba2\u9605\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Excel \u4e2d\u7684 Python \u73b0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u9002\u7528\u4e8e Microsoft 365 \u5546\u4e1a\u7248\u548c\u4f01\u4e1a\u7248\u7684 Windows \u7528\u6237\u3002\u53bb\u5e74 8 \u6708\uff0c\u5fae\u8f6f\u4e0e Anaconda \u5408\u4f5c\uff0c\u901a\u8fc7\u96c6\u6210 Python \u4e3a Excel \u5f15\u5165\u4e86\u4e00\u4e2a\u4ee4\u4eba\u5174\u594b\u7684\u65b0\u589e\u529f\u80fd\uff0c\u4ece&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[],"class_list":["post-6588","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts\/6588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/comments?post=6588"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/posts\/6588\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/media?parent=6588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/categories?post=6588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/ja\/wp-json\/wp\/v2\/tags?post=6588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}