{"id":45200,"date":"2025-06-22T13:20:51","date_gmt":"2025-06-22T05:20:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/45200.html"},"modified":"2025-06-22T13:20:51","modified_gmt":"2025-06-22T05:20:51","slug":"python-%e6%95%b0%e6%8d%ae%e5%88%86%e6%9e%90%e4%b8%8e%e5%8f%af%e8%a7%86%e5%8c%96-day-3-pandas-%e6%95%b0%e6%8d%ae%e7%ad%9b%e9%80%89%e4%b8%8e%e6%8e%92%e5%ba%8f%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/45200.html","title":{"rendered":"Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c"},"content":{"rendered":"<h4>&#x1f3af; \u4eca\u65e5\u76ee\u6807<\/h4>\n<ul>\n<li>\u638c\u63e1 DataFrame \u7684\u6761\u4ef6\u7b5b\u9009&#xff08;\u5e03\u5c14\u7d22\u5f15&#xff09;<\/li>\n<li>\u5b66\u4f1a\u591a\u6761\u4ef6\u7b5b\u9009\u3001\u903b\u8f91\u8fd0\u7b97<\/li>\n<li>\u719f\u7ec3\u4f7f\u7528\u6392\u5e8f&#xff08;sort_values&#xff09;\u63d0\u5347\u6570\u636e\u7ec4\u7ec7\u529b<\/li>\n<li>\u7ed3\u5408\u5217\u9009\u62e9\u8fdb\u884c\u6570\u636e\u63d0\u53d6\u5206\u6790<\/li>\n<\/ul>\n<hr \/>\n<h3>&#x1f9ea; \u4e00\u3001\u5217\u9009\u62e9\u4e0e\u57fa\u672c\u7b5b\u9009<\/h3>\n<h4>\u2705 \u9009\u62e9\u5355\u5217 \/ \u591a\u5217<\/h4>\n<p>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span>          <span class=\"token comment\"># \u8fd4\u56de Series<\/span><br \/>\ndf<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u59d3\u540d&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token comment\"># \u8fd4\u56de\u65b0\u7684 DataFrame<\/span><\/p>\n<hr \/>\n<h4>\u2705 \u6761\u4ef6\u7b5b\u9009&#xff08;\u5e03\u5c14\u7d22\u5f15&#xff09;<\/h4>\n<p><span class=\"token comment\"># \u7b5b\u9009\u51fa\u6210\u7ee9\u5927\u4e8e 80 \u7684\u5b66\u751f<\/span><br \/>\ndf<span class=\"token punctuation\">[<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">80<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token comment\"># \u83b7\u53d6\u6027\u522b\u4e3a\u201c\u5973\u201d\u7684\u5b66\u751f<\/span><br \/>\ndf<span class=\"token punctuation\">[<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6027\u522b&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;\u5973&#034;<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<hr \/>\n<h4>\u2705 \u591a\u6761\u4ef6\u7b5b\u9009&#xff08;\u903b\u8f91\u8fd0\u7b97\u7b26&#xff09;<\/h4>\n<p><span class=\"token comment\"># \u6210\u7ee9\u5927\u4e8e 80 \u4e14\u662f\u7537\u751f<\/span><br \/>\ndf<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">80<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;<\/span> <span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6027\u522b&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;\u7537&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token comment\"># \u6210\u7ee9\u4e0d\u53ca\u683c \u6216 \u672a\u586b\u5199\u662f\u5426\u53ca\u683c<\/span><br \/>\ndf<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">|<\/span> <span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u662f\u5426\u53ca\u683c&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token boolean\">False<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>\u26a0\ufe0f \u6ce8\u610f&#xff1a;\u903b\u8f91\u8fd0\u7b97\u4f7f\u7528 &amp;\u3001|\u3001~&#xff0c;\u5e76\u52a0\u4e0a\u62ec\u53f7&#xff01;<\/p>\n<hr \/>\n<h3>&#x1f522; \u4e8c\u3001\u6570\u636e\u6392\u5e8f<\/h3>\n<h4>\u2705 \u6309\u5355\u5217\u6392\u5e8f<\/h4>\n<p>df<span class=\"token punctuation\">.<\/span>sort_values<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">)<\/span>                     <span class=\"token comment\"># \u5347\u5e8f<\/span><br \/>\ndf<span class=\"token punctuation\">.<\/span>sort_values<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">,<\/span> ascending<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">False<\/span><span class=\"token punctuation\">)<\/span>   <span class=\"token comment\"># \u964d\u5e8f<\/span><\/p>\n<h4>\u2705 \u6309\u591a\u4e2a\u5b57\u6bb5\u6392\u5e8f<\/h4>\n<p>df<span class=\"token punctuation\">.<\/span>sort_values<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u662f\u5426\u53ca\u683c&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> ascending<span class=\"token operator\">&#061;<\/span><span class=\"token punctuation\">[<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">False<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<hr \/>\n<h3>&#x1f50d; \u4e09\u3001\u5217\u9009\u62e9 &#043; \u6392\u5e8f\u7efc\u5408\u7ec3\u4e60<\/h3>\n<p>df<span class=\"token punctuation\">[<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6027\u522b&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;\u5973&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u59d3\u540d&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>sort_values<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">,<\/span> ascending<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">False<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<hr \/>\n<h3>&#x1f9ea; \u4eca\u65e5\u7ec3\u4e60\u4efb\u52a1<\/h3>\n<p>\u4f7f\u7528\u524d\u4e24\u5929\u5904\u7406\u597d\u7684 students_cleaned.csv \u6587\u4ef6&#xff0c;\u5b8c\u6210\u4ee5\u4e0b\u64cd\u4f5c&#xff1a;<\/p>\n<h4>&#x1f4dd; \u7ec3\u4e60\u5217\u8868<\/h4>\n<li>\n<p>\u7b5b\u9009\u51fa\u6210\u7ee9\u5927\u4e8e\u7b49\u4e8e 80 \u7684\u5b66\u751f<\/p>\n<\/li>\n<li>\n<p>\u7b5b\u9009\u51fa\u6210\u7ee9\u4e0d\u53ca\u683c\u7684\u7537\u751f<\/p>\n<\/li>\n<li>\n<p>\u6309\u6210\u7ee9\u4ece\u9ad8\u5230\u4f4e\u6392\u5e8f&#xff0c;\u5e76\u53ea\u663e\u793a\u201c\u59d3\u540d\u201d\u548c\u201c\u6210\u7ee9\u201d<\/p>\n<\/li>\n<li>\n<p>\u7edf\u8ba1\u7537\u5973\u751f\u4eba\u6570&#xff08;\u4f7f\u7528 value_counts&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u6309\u6027\u522b\u5206\u7ec4\u540e&#xff0c;\u8ba1\u7b97\u5404\u7ec4\u5e73\u5747\u6210\u7ee9&#xff08;\u4f7f\u7528 groupby&#xff09;<\/p>\n<p> <span class=\"token keyword\">import<\/span> pandas <span class=\"token keyword\">as<\/span> pd<br \/>\n<span class=\"token keyword\">import<\/span> os<\/p>\n<p><span class=\"token comment\"># \u52a0\u8f7d\u6570\u636e\u6587\u4ef6\u8def\u5f84<\/span><br \/>\ninput_path <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;data\/students_cleaned.csv&#034;<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> <span class=\"token keyword\">not<\/span> os<span class=\"token punctuation\">.<\/span>path<span class=\"token punctuation\">.<\/span>exists<span class=\"token punctuation\">(<\/span>input_path<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">raise<\/span> FileNotFoundError<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u274c \u627e\u4e0d\u5230\u6587\u4ef6&#xff1a;data\/students_cleaned.csv\u3002\u8bf7\u5148\u8fd0\u884c\u524d\u4e24\u5929\u7684\u6e05\u6d17\u811a\u672c\u3002&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u52a0\u8f7d DataFrame<\/span><br \/>\ndf <span class=\"token operator\">&#061;<\/span> pd<span class=\"token punctuation\">.<\/span>read_csv<span class=\"token punctuation\">(<\/span>input_path<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#x1f4ca; \u6570\u636e\u52a0\u8f7d\u6210\u529f&#xff1a;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">.<\/span>head<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># 1. \u7b5b\u9009\u51fa\u6210\u7ee9 \u2265 80 \u7684\u5b66\u751f<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&#x1f3af; \u6210\u7ee9 \u2265 80 \u7684\u5b66\u751f&#xff1a;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">80<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># 2. \u7b5b\u9009\u51fa\u6210\u7ee9\u4e0d\u53ca\u683c\u7684\u7537\u751f<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&#x1f3af; \u6210\u7ee9\u4e0d\u53ca\u683c\u7684\u7537\u751f&#xff1a;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\ncondition <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&amp;<\/span> <span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6027\u522b&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;\u7537&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span>condition<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># 3. \u6309\u6210\u7ee9\u4ece\u9ad8\u5230\u4f4e\u6392\u5e8f&#xff0c;\u663e\u793a\u201c\u59d3\u540d\u201d\u548c\u201c\u6210\u7ee9\u201d<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&#x1f3af; \u6309\u6210\u7ee9\u6392\u5e8f&#xff08;\u964d\u5e8f&#xff09;\u663e\u793a\u59d3\u540d\u548c\u6210\u7ee9&#xff1a;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nsorted_df <span class=\"token operator\">&#061;<\/span> df<span class=\"token punctuation\">.<\/span>sort_values<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">,<\/span> ascending<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">False<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u59d3\u540d&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>sorted_df<span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># 4. \u7edf\u8ba1\u6027\u522b\u5206\u5e03<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&#x1f3af; \u7537\u5973\u751f\u4eba\u6570\u7edf\u8ba1&#xff1a;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6027\u522b&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>value_counts<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># 5. \u6309\u6027\u522b\u5206\u7ec4&#xff0c;\u7edf\u8ba1\u5e73\u5747\u6210\u7ee9<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&#x1f3af; \u6309\u6027\u522b\u5206\u7ec4\u7684\u5e73\u5747\u6210\u7ee9&#xff1a;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>df<span class=\"token punctuation\">.<\/span>groupby<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u6027\u522b&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;\u6210\u7ee9&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">.<\/span>mean<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u7ed3\u679c\u8f93\u51fa&#xff1a;<\/p>\n<p> &#x1f4ca; \u6570\u636e\u52a0\u8f7d\u6210\u529f&#xff1a;<br \/>\n   \u59d3\u540d \u6027\u522b    \u6210\u7ee9   \u662f\u5426\u53ca\u683c<br \/>\n<span class=\"token number\">0<\/span>  \u5f20\u4e09  \u7537  <span class=\"token number\">88.0<\/span>   <span class=\"token boolean\">True<\/span><br \/>\n<span class=\"token number\">1<\/span>  \u674e\u56db  \u5973  <span class=\"token number\">78.0<\/span>   <span class=\"token boolean\">True<\/span><br \/>\n<span class=\"token number\">2<\/span>  \u738b\u4e94  \u7537  <span class=\"token number\">59.0<\/span>  <span class=\"token boolean\">False<\/span><br \/>\n<span class=\"token number\">3<\/span>  \u7530\u4e03  \u5973  <span class=\"token number\">78.0<\/span>  <span class=\"token boolean\">False<\/span><\/p>\n<p>&#x1f3af; \u6210\u7ee9 \u2265 <span class=\"token number\">80<\/span> \u7684\u5b66\u751f&#xff1a;<br \/>\n   \u59d3\u540d \u6027\u522b    \u6210\u7ee9  \u662f\u5426\u53ca\u683c<br \/>\n<span class=\"token number\">0<\/span>  \u5f20\u4e09  \u7537  <span class=\"token number\">88.0<\/span>  <span class=\"token boolean\">True<\/span><\/p>\n<p>&#x1f3af; \u6210\u7ee9\u4e0d\u53ca\u683c\u7684\u7537\u751f&#xff1a;<br \/>\n   \u59d3\u540d \u6027\u522b    \u6210\u7ee9   \u662f\u5426\u53ca\u683c<br \/>\n<span class=\"token number\">2<\/span>  \u738b\u4e94  \u7537  <span class=\"token number\">59.0<\/span>  <span class=\"token boolean\">False<\/span><\/p>\n<p>&#x1f3af; \u6309\u6210\u7ee9\u6392\u5e8f&#xff08;\u964d\u5e8f&#xff09;\u663e\u793a\u59d3\u540d\u548c\u6210\u7ee9&#xff1a;<br \/>\n   \u59d3\u540d    \u6210\u7ee9<br \/>\n<span class=\"token number\">0<\/span>  \u5f20\u4e09  <span class=\"token number\">88.0<\/span><br \/>\n<span class=\"token number\">1<\/span>  \u674e\u56db  <span class=\"token number\">78.0<\/span><br \/>\n<span class=\"token number\">3<\/span>  \u7530\u4e03  <span class=\"token number\">78.0<\/span><br \/>\n<span class=\"token number\">2<\/span>  \u738b\u4e94  <span class=\"token number\">59.0<\/span><\/p>\n<p>&#x1f3af; \u7537\u5973\u751f\u4eba\u6570\u7edf\u8ba1&#xff1a;<br \/>\n\u6027\u522b<br \/>\n\u7537    <span class=\"token number\">2<\/span><br \/>\n\u5973    <span class=\"token number\">2<\/span><br \/>\nName<span class=\"token punctuation\">:<\/span> count<span class=\"token punctuation\">,<\/span> dtype<span class=\"token punctuation\">:<\/span> int64<\/p>\n<p>&#x1f3af; \u6309\u6027\u522b\u5206\u7ec4\u7684\u5e73\u5747\u6210\u7ee9&#xff1a;<br \/>\n\u6027\u522b<br \/>\n\u5973    <span class=\"token number\">78.0<\/span><br \/>\n\u7537    <span class=\"token number\">73.5<\/span><br \/>\nName<span class=\"token punctuation\">:<\/span> \u6210\u7ee9<span class=\"token punctuation\">,<\/span> dtype<span class=\"token punctuation\">:<\/span> float64\n <\/li>\n<hr \/>\n<h3>\u270d\ufe0f \u4eca\u65e5\u603b\u7ed3<\/h3>\n<ul>\n<li>\u638c\u63e1\u4e86\u5e03\u5c14\u7d22\u5f15\u4e0e\u903b\u8f91\u8fd0\u7b97\u7b5b\u9009\u6570\u636e<\/li>\n<li>\u719f\u6089\u4e86\u591a\u5217\u7ec4\u5408\u6392\u5e8f\u64cd\u4f5c<\/li>\n<li>\u5b66\u4f1a\u4e86\u5e38\u7528\u7684\u6570\u636e\u5b50\u96c6\u63d0\u53d6\u65b9\u6cd5<\/li>\n<li>\u521d\u6b65\u63a5\u89e6\u4e86\u5206\u7ec4\u805a\u5408\u5206\u6790<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb449\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Pandas\u6570\u636e\u5904\u7406\u4e2d\u7684\u6838\u5fc3\u64cd\u4f5c\uff1a\u6761\u4ef6\u7b5b\u9009\u4e0e\u6570\u636e\u6392\u5e8f\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09\u5355\u5217\/\u591a\u5217\u9009\u62e9\u65b9\u6cd5\uff1b2\uff09\u4f7f\u7528\u5e03\u5c14\u7d22\u5f15\u8fdb\u884c\u5355\u6761\u4ef6\/\u591a\u6761\u4ef6\u7b5b\u9009\uff1b3\uff09\u6309\u5355\u5217\u6216\u591a\u5217\u8fdb\u884c\u5347\u964d\u5e8f\u6392\u5e8f\uff1b4\uff09\u7efc\u5408\u5e94\u7528\u5217\u9009\u62e9\u548c\u6392\u5e8f\u7684\u5b9e\u6218\u6848\u4f8b\u3002\u901a\u8fc7students_cleaned.csv\u6587\u4ef6\u7684\u7ec3\u4e60\u4efb\u52a1\uff0c\u6f14\u793a\u4e86\u6210\u7ee9\u7b5b\u9009\u3001\u6027\u522b\u7edf\u8ba1\u3001\u5206\u7ec4\u8ba1\u7b97\u5e73\u5747\u6210\u7ee9\u7b49\u5178\u578b\u6570\u636e\u5904\u7406\u573a\u666f\u3002\u5b66\u4e60\u91cd\u70b9\u5728\u4e8e\u638c\u63e1\u903b\u8f91\u8fd0\u7b97\u7b26(&amp;|~)\u7684\u89c4\u8303\u4f7f\u7528\uff0c\u4ee5\u53ca\u5c06\u7b5b\u9009\u3001\u6392\u5e8f\u3001\u805a\u5408\u7b49\u65b9\u6cd5\u7ec4\u5408\u8fd0\u7528\u7684\u6280\u5de7\uff0c\u4e3a\u540e\u7eed\u6570\u636e\u5206\u6790\u6253\u4e0b\u57fa\u7840\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4278,81,801],"topic":[],"class_list":["post-45200","post","type-post","status-publish","format-standard","hentry","category-server","tag-pandas","tag-python","tag-801"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/45200.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb449\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Pandas\u6570\u636e\u5904\u7406\u4e2d\u7684\u6838\u5fc3\u64cd\u4f5c\uff1a\u6761\u4ef6\u7b5b\u9009\u4e0e\u6570\u636e\u6392\u5e8f\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09\u5355\u5217\/\u591a\u5217\u9009\u62e9\u65b9\u6cd5\uff1b2\uff09\u4f7f\u7528\u5e03\u5c14\u7d22\u5f15\u8fdb\u884c\u5355\u6761\u4ef6\/\u591a\u6761\u4ef6\u7b5b\u9009\uff1b3\uff09\u6309\u5355\u5217\u6216\u591a\u5217\u8fdb\u884c\u5347\u964d\u5e8f\u6392\u5e8f\uff1b4\uff09\u7efc\u5408\u5e94\u7528\u5217\u9009\u62e9\u548c\u6392\u5e8f\u7684\u5b9e\u6218\u6848\u4f8b\u3002\u901a\u8fc7students_cleaned.csv\u6587\u4ef6\u7684\u7ec3\u4e60\u4efb\u52a1\uff0c\u6f14\u793a\u4e86\u6210\u7ee9\u7b5b\u9009\u3001\u6027\u522b\u7edf\u8ba1\u3001\u5206\u7ec4\u8ba1\u7b97\u5e73\u5747\u6210\u7ee9\u7b49\u5178\u578b\u6570\u636e\u5904\u7406\u573a\u666f\u3002\u5b66\u4e60\u91cd\u70b9\u5728\u4e8e\u638c\u63e1\u903b\u8f91\u8fd0\u7b97\u7b26(&amp;|~)\u7684\u89c4\u8303\u4f7f\u7528\uff0c\u4ee5\u53ca\u5c06\u7b5b\u9009\u3001\u6392\u5e8f\u3001\u805a\u5408\u7b49\u65b9\u6cd5\u7ec4\u5408\u8fd0\u7528\u7684\u6280\u5de7\uff0c\u4e3a\u540e\u7eed\u6570\u636e\u5206\u6790\u6253\u4e0b\u57fa\u7840\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/45200.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-22T05:20:51+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.wsisp.com\/helps\/45200.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/45200.html\",\"name\":\"Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-22T05:20:51+00:00\",\"dateModified\":\"2025-06-22T05:20:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/45200.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/45200.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/45200.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/45200.html","og_locale":"zh_CN","og_type":"article","og_title":"Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb449\u6b21\uff0c\u70b9\u8d5e19\u6b21\uff0c\u6536\u85cf11\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Pandas\u6570\u636e\u5904\u7406\u4e2d\u7684\u6838\u5fc3\u64cd\u4f5c\uff1a\u6761\u4ef6\u7b5b\u9009\u4e0e\u6570\u636e\u6392\u5e8f\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a1\uff09\u5355\u5217\/\u591a\u5217\u9009\u62e9\u65b9\u6cd5\uff1b2\uff09\u4f7f\u7528\u5e03\u5c14\u7d22\u5f15\u8fdb\u884c\u5355\u6761\u4ef6\/\u591a\u6761\u4ef6\u7b5b\u9009\uff1b3\uff09\u6309\u5355\u5217\u6216\u591a\u5217\u8fdb\u884c\u5347\u964d\u5e8f\u6392\u5e8f\uff1b4\uff09\u7efc\u5408\u5e94\u7528\u5217\u9009\u62e9\u548c\u6392\u5e8f\u7684\u5b9e\u6218\u6848\u4f8b\u3002\u901a\u8fc7students_cleaned.csv\u6587\u4ef6\u7684\u7ec3\u4e60\u4efb\u52a1\uff0c\u6f14\u793a\u4e86\u6210\u7ee9\u7b5b\u9009\u3001\u6027\u522b\u7edf\u8ba1\u3001\u5206\u7ec4\u8ba1\u7b97\u5e73\u5747\u6210\u7ee9\u7b49\u5178\u578b\u6570\u636e\u5904\u7406\u573a\u666f\u3002\u5b66\u4e60\u91cd\u70b9\u5728\u4e8e\u638c\u63e1\u903b\u8f91\u8fd0\u7b97\u7b26(&amp;|~)\u7684\u89c4\u8303\u4f7f\u7528\uff0c\u4ee5\u53ca\u5c06\u7b5b\u9009\u3001\u6392\u5e8f\u3001\u805a\u5408\u7b49\u65b9\u6cd5\u7ec4\u5408\u8fd0\u7528\u7684\u6280\u5de7\uff0c\u4e3a\u540e\u7eed\u6570\u636e\u5206\u6790\u6253\u4e0b\u57fa\u7840\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/45200.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-22T05:20:51+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.wsisp.com\/helps\/45200.html","url":"https:\/\/www.wsisp.com\/helps\/45200.html","name":"Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-22T05:20:51+00:00","dateModified":"2025-06-22T05:20:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/45200.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/45200.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/45200.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Python \u6570\u636e\u5206\u6790\u4e0e\u53ef\u89c6\u5316 Day 3 - Pandas \u6570\u636e\u7b5b\u9009\u4e0e\u6392\u5e8f\u64cd\u4f5c"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/45200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=45200"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/45200\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=45200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=45200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=45200"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=45200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}