{"id":349601,"date":"2024-01-09T06:13:40","date_gmt":"2024-01-08T22:13:40","guid":{"rendered":"https:\/\/www.idc.net\/help\/349601\/"},"modified":"2024-01-09T06:13:40","modified_gmt":"2024-01-08T22:13:40","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8%e5%90%af%e5%8a%a8jupyter-notebook%e6%97%b6%e8%87%aa%e5%8a%a8%e6%89%a7%e8%a1%8c%e4%b8%80%e6%ae%b5%e4%bb%a3%e7%a0%81%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/349601\/","title":{"rendered":"\u5982\u4f55\u5728\u542f\u52a8Jupyter Notebook\u65f6\u81ea\u52a8\u6267\u884c\u4e00\u6bb5\u4ee3\u7801\uff1f"},"content":{"rendered":"<p style=\"text-align: center\">\n<p>\u5728\u6211\u4eec\u4f7f\u7528Jupyter Notebook\u5199\u4ee3\u7801\u65f6\uff0c\u542f\u52a8\u540e\u603b\u662f\u9700\u8981\u5bfc\u5165\u4e00\u4e9b\u5e93\u5e76\u8fdb\u914d\u7f6e\uff0c\u5c24\u5176\u662f\u7528\u6765\u505a\u6570\u636e\u5206\u6790\u65f6\uff0c\u6253\u5f00\u540e\u80af\u5b9a\u662f\u5149\u901f\u952e\u5165\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>import&nbsp;pandas&nbsp;as&nbsp;pd&nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>import&nbsp;numpy&nbsp;as&nbsp;np&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>from&nbsp;sklearn&nbsp;import&nbsp;svm,&nbsp;tree,&nbsp;linear_model,&nbsp;neighbors,&nbsp;naive_bayes,&nbsp;ensemble,&nbsp;discriminant_analysis,&nbsp;gaussian_process&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>from&nbsp;xgboost&nbsp;import&nbsp;XGBClassifier&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>from&nbsp;sklearn.preprocessing&nbsp;import&nbsp;OneHotEncoder,&nbsp;LabelEncoder&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>from&nbsp;sklearn&nbsp;import&nbsp;feature_selection&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>from&nbsp;sklearn&nbsp;import&nbsp;model_selection&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>.......&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>\u867d\u7136\u4ee3\u7801\u91cf\u4e0d\u5927\uff0c\u4f46\u662f\u6bcf\u6253\u5f00\u4e00\u6b21notebook\u90fd\u8981\u8f93\u5165\u4e00\u6b21\uff0c\u603b\u611f\u89c9\u5f88\u7e41\u7410\uff0c\u5982\u679c\u518d\u7528\u4e0apyecharts\u7b49\u5176\u4ed6\u5e93\u90a3\u4e48\u5149\u5bfc\u5165\u5404\u79cd\u5305\u5c31\u8981\u6d88\u8017\u5f88\u591a\u65f6\u95f4\uff0c\u5e76\u4e14\u8fd8\u6709\u53ef\u80fd\u624b\u6ed1\u8f93\u9519\u4e86\u3002<\/p>\n<p>\u90a3\u4e48\u6709\u4ec0\u4e48\u529e\u6cd5\u80fd\u8ba9jupter notebook\/ipython\u5728\u542f\u52a8\u65f6\u81ea\u52a8\u52a0\u8f7d\u4e00\u6bb5\u6211\u4eec\u9700\u8981\u7684\u4ee3\u7801\u5462?\u4e0b\u9762\u5206\u4eab\u4e00\u4e2a\u5077\u61d2\u5c0f\u5999\u62db\uff5e<\/p>\n<p>\u5728Mac\u4e0b\u4f60\u53ef\u4ee5\u8fdb\u5165~\/.ipython\/profile_default\u6587\u4ef6\u5939(Windows\u4e0b\u4e5f\u53ef\u4ee5\u5728\u5b89\u88c5\u76ee\u5f55\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\u6587\u4ef6\u5939)\uff0c\u5982\u679c\u627e\u4e0d\u5230\u8be5\u76ee\u5f55\u9700\u5728\u547d\u4ee4\u884c\u6267\u884cipython profile create\u751f\u6210\u914d\u7f6e\u6587\u4ef6<\/p>\n<p style=\"text-align: center\">\n<p>\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u5728\u8be5\u6587\u4ef6\u5939\u4e0b\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3astartup\u7684\u6587\u4ef6\u5939(\u5982\u679c\u6709\u5219\u4e0d\u7528\u65b0\u5efa)\uff0c\u4e4b\u540e\u8fdb\u5165startup\u6587\u4ef6\u5939\u65b0\u5efa\u4e00\u4e2aPython\u811a\u672cstart.py<\/p>\n<p>\u73b0\u5728\u4f60\u53ef\u4ee5\u5728start.py\u4e2d\u5c3d\u60c5\u7684\u6dfb\u52a0\u4f60\u6bcf\u6b21\u542f\u52a8jupyter notebook\u540e\u90fd\u9700\u8981\u624b\u52a8\u6572\u5165\u7684\u90a3\u6bb5\u4ee3\u7801\uff0c\u4e4b\u540e\u4fdd\u5b58\u5373\u53ef\uff0c\u518d\u6b21\u6253\u5f00jupyter notebook\u5e76\u65b0\u5efa\u4e00\u4e2anotebook\u540e\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528pandas\u3001numpy\u7b49\u6211\u4eec\u914d\u7f6e\u597d\u7684\u5e93!<\/p>\n<p style=\"text-align: center\">\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6211\u4eec\u4f7f\u7528Jupyter Notebook\u5199\u4ee3\u7801\u65f6\uff0c\u542f\u52a8\u540e\u603b\u662f\u9700\u8981\u5bfc\u5165\u4e00\u4e9b\u5e93\u5e76\u8fdb\u914d\u7f6e\uff0c\u5c24\u5176\u662f\u7528\u6765\u505a\u6570\u636e\u5206\u6790\u65f6\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":349602,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-349601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-website"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/349601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=349601"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/349601\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/349602"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=349601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=349601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=349601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}