lt;pgt;lt;stronggt;lt;/stronggt;lt;/pgt;lt;div class=quot;separatorquot; style=quot;clear: both; text-align: center;quot;gt;lt;stronggt;lt;a href=quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM4AT00HF6X8qmeoGiAt_NJROvB26ehCpSeT1gCMYocmoTemdr8a9AXd3iXQZ1YZN9uRyh5ihU40DYFSIUklRauSpIbbIxlckbC9lwuwVVtmtSE354et_zWm_aR-B2R1iaSYlc4uoCbWkxC-TRsfzDcuAlnqO7RC0mcMlY40gg1l-Oh-uS-s3vg3Kp4VI/s1024/DALL%C2%B7E%202025-03-10%2006.51.07%20-%20A%20futuristic%20logo%20representing%20#39;pandas#39;%20in%20Python,%20styled%20with%20Machine%20Learning%20elements.%20The%20design%20should%20incorporate%20AI%20and%20data%20visualization%20them.webpquot; style=quot;margin-left: 1em; margin-right: 1em;quot;gt;lt;img border=quot;0quot; data-original-height=quot;1024quot; data-original-width=quot;1024quot; height=quot;320quot; src=quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM4AT00HF6X8qmeoGiAt_NJROvB26ehCpSeT1gCMYocmoTemdr8a9AXd3iXQZ1YZN9uRyh5ihU40DYFSIUklRauSpIbbIxlckbC9lwuwVVtmtSE354et_zWm_aR-B2R1iaSYlc4uoCbWkxC-TRsfzDcuAlnqO7RC0mcMlY40gg1l-Oh-uS-s3vg3Kp4VI/s320/DALL%C2%B7E%202025-03-10%2006.51.07%20-%20A%20futuristic%20logo%20representing%20#39;pandas#39;%20in%20Python,%20styled%20with%20Machine%20Learning%20elements.%20The%20design%20should%20incorporate%20AI%20and%20data%20visualization%20them.webpquot; width=quot;320quot; /gt;lt;/agt;lt;/stronggt;lt;/divgt;lt;stronggt;lt;span style=quot;color: #990000;quot;gt;lt;br /gt;lt;/spangt;lt;/stronggt;lt;pgt;lt;/pgt;lt;pgt;lt;stronggt;lt;span style=quot;color: #990000;quot;gt;01. Cài đặt pandaslt;/spangt;lt;/stronggt;lt;/pgt;
lt;pgt;Bạn có thể cài đặt lt;stronggt;pandaslt;/stronggt; bằng pip với lệnh sau:lt;/pgt;
lt;pregt;lt;code class=quot;language-bashquot;gt;lt;span style=quot;background-color: black; color: #f3f3f3;quot;gt;lt;bgt;pip install pandaslt;/bgt;lt;/spangt;
lt;/codegt;lt;/pregt;
lt;pgt;Nếu bạn muốn cài đặt lt;stronggt;pandaslt;/stronggt; cùng với lt;stronggt;numpylt;/stronggt; và lt;stronggt;matplotliblt;/stronggt; để hỗ trợ phân tích dữ liệu, sử dụng:lt;/pgt;
lt;pregt;lt;code class=quot;language-bashquot;gt;lt;span style=quot;background-color: black; color: #f3f3f3;quot;gt;lt;bgt;pip install pandas numpy matplotliblt;/bgt;lt;/spangt;
lt;/codegt;lt;/pregt;
lt;pgt;Nếu bạn đang sử dụng lt;stronggt;Jupyter Notebooklt;/stronggt;, có thể dùng:lt;/pgt;
lt;pregt;lt;code class=quot;language-pythonquot;gt;lt;span style=quot;background-color: black; color: #f3f3f3;quot;gt;lt;bgt;!pip install pandaslt;/bgt;lt;/spangt;
lt;/codegt;lt;/pregt;
lt;hr /gt;
lt;h4gt;lt;stronggt;lt;span style=quot;color: #990000;quot;gt;lt;spangt;lt;a name=#39;more#39;gt;lt;/agt;lt;/spangt;02. Sử dụng pandas trong Pythonlt;/spangt;lt;/stronggt;lt;/h4gt;
lt;pgt;Sau khi cài đặt, bạn có thể sử dụng lt;stronggt;pandaslt;/stronggt; như sau:lt;/pgt;
lt;h5gt;lt;stronggt;2.1. Import pandaslt;/stronggt;lt;/h5gt;
lt;pregt;lt;code class=quot;language-pythonquot;gt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px;quot;gt;lt;span style=quot;color: #c586c0;quot;gt;importlt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pandaslt;/spangt; lt;span style=quot;color: #c586c0;quot;gt;aslt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pdlt;/spangt;lt;/divgt;lt;/codegt;lt;/pregt;
lt;h5gt;lt;stronggt;2.2. Tạo DataFrame từ danh sáchlt;/stronggt;lt;/h5gt;
lt;pregt;lt;code class=quot;language-pythonquot;gt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px;quot;gt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;datalt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; {lt;span style=quot;color: #ce9178;quot;gt;#39;Tên#39;lt;/spangt;: [lt;span style=quot;color: #ce9178;quot;gt;#39;An#39;lt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;#39;Bình#39;lt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;#39;Chi#39;lt;/spangt;],lt;/divgt;lt;divgt; lt;span style=quot;color: #ce9178;quot;gt;#39;Tuổi#39;lt;/spangt;: [lt;span style=quot;color: #b5cea8;quot;gt;25lt;/spangt;, lt;span style=quot;color: #b5cea8;quot;gt;30lt;/spangt;, lt;span style=quot;color: #b5cea8;quot;gt;35lt;/spangt;],lt;/divgt;lt;divgt; lt;span style=quot;color: #ce9178;quot;gt;#39;Thành phố#39;lt;/spangt;: [lt;span style=quot;color: #ce9178;quot;gt;#39;Hà Nội#39;lt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;#39;HCM#39;lt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;#39;Đà Nẵng#39;lt;/spangt;]}lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pdlt;/spangt;.lt;span style=quot;color: #4ec9b0;quot;gt;DataFramelt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;datalt;/spangt;)lt;/divgt;lt;divgt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;)lt;/divgt;lt;/divgt;lt;/codegt;lt;/pregt;
lt;h5gt;lt;stronggt;2.3. Đọc dữ liệu từ file CSVlt;/stronggt;lt;/h5gt;
lt;pregt;lt;code class=quot;language-pythonquot;gt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px;quot;gt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pdlt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;read_csvlt;/spangt;(lt;span style=quot;color: #ce9178;quot;gt;quot;data.csvquot;lt;/spangt;)lt;/divgt;lt;divgt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;headlt;/spangt;()) lt;span style=quot;color: #6a9955;quot;gt;# Xem 5 dòng đầu tiênlt;/spangt;lt;/divgt;lt;/divgt;lt;/codegt;lt;/pregt;
lt;h5gt;lt;stronggt;2.4. Ghi DataFrame ra file CSVlt;/stronggt;lt;/h5gt;
lt;pregt;lt;code class=quot;language-pythonquot;gt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px;quot;gt;lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;to_csvlt;/spangt;(lt;span style=quot;color: #ce9178;quot;gt;quot;output.csvquot;lt;/spangt;, lt;span style=quot;color: #9cdcfe;quot;gt;indexlt;/spangt;lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt;lt;span style=quot;color: #569cd6;quot;gt;Falselt;/spangt;)lt;/divgt;lt;/codegt;lt;/pregt;
lt;h5gt;lt;stronggt;2.5. Thao tác dữ liệult;/stronggt;lt;/h5gt;
lt;ulgt;
lt;ligt;Lấy dữ liệu của một cột:
lt;pregt;lt;code class=quot;language-pythonquot;gt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px;quot;gt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;[lt;span style=quot;color: #ce9178;quot;gt;#39;Tên#39;lt;/spangt;])lt;/divgt;lt;/codegt;lt;/pregt;
lt;/ligt;
lt;ligt;Lọc dữ liệu:
lt;pregt;lt;code class=quot;language-pythonquot;gt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px;quot;gt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;[lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;[lt;span style=quot;color: #ce9178;quot;gt;#39;Tuổi#39;lt;/spangt;] lt;span style=quot;color: #dcdcaa;quot;gt;gt;lt;/spangt; lt;span style=quot;color: #b5cea8;quot;gt;28lt;/spangt;])lt;/divgt;lt;/codegt;lt;/pregt;
lt;/ligt;
lt;ligt;Tính toán thống kê:
lt;pregt;lt;code class=quot;language-pythonquot;gt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px;quot;gt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;describelt;/spangt;()) lt;span style=quot;color: #6a9955;quot;gt;# Thống kê cơ bảnlt;/spangt;lt;/divgt;lt;/codegt;lt;/pregt;
lt;/ligt;
lt;/ulgt;
lt;hr /gt;
lt;h3gt;lt;stronggt;Link trang official của pandaslt;/stronggt;lt;/h3gt;
lt;pgt;📌 lt;a href=quot;https://pandas.pydata.org/quot; rel=quot;nofollowquot; target=quot;_blankquot;gt;https://pandas.pydata.orglt;/agt;lt;/pgt;
lt;pgt;Trang này chứa tài liệu chính thức, hướng dẫn, và API reference cho pandas.lt;/pgt;lt;pgt;lt;br /gt;lt;/pgt;lt;pgt;Khởi động lại lt;span style=quot;color: #0b5394;quot;gt;lt;bgt;VSCodelt;/bgt;lt;/spangt; để cập nhật -gt; Nếu vẫn lỗi thì đọc tiếp:lt;/pgt;
lt;h3gt;lt;stronggt;Lệnh nâng cấp piplt;/stronggt;lt;/h3gt;
lt;pregt;lt;code class=quot;language-bashquot;gt;lt;span style=quot;background-color: black; color: #f3f3f3;quot;gt;lt;bgt;python -m pip install --upgrade piplt;/bgt;lt;/spangt;
lt;/codegt;lt;/pregt;
lt;pgt;lt;stronggt;Giải thích:lt;/stronggt;lt;/pgt;
lt;ulgt;
lt;ligt;lt;code inline=quot;quot;gt;python -mlt;/codegt; → Chạy module lt;stronggt;piplt;/stronggt; bằng trình thông dịch Python.lt;/ligt;
lt;ligt;lt;code inline=quot;quot;gt;pip install --upgrade piplt;/codegt; → Cập nhật lt;stronggt;piplt;/stronggt; lên phiên bản mới nhất.lt;/ligt;
lt;/ulgt;
lt;h3gt;lt;stronggt;Nếu dùng Python3 (trên Linux/macOS)lt;/stronggt;lt;/h3gt;
lt;pregt;lt;code class=quot;language-bashquot;gt;lt;span style=quot;background-color: black; color: #f3f3f3;quot;gt;lt;bgt;python3 -m pip install --upgrade piplt;/bgt;lt;/spangt;
lt;/codegt;lt;/pregt;
lt;h3gt;lt;stronggt;Kiểm tra phiên bản pip sau khi nâng cấplt;/stronggt;lt;/h3gt;
lt;pregt;lt;code class=quot;language-bashquot;gt;lt;span style=quot;background-color: black; color: #f3f3f3;quot;gt;lt;bgt;pip --versionlt;/bgt;lt;/spangt;
lt;/codegt;lt;/pregt;
lt;pgt;💡 lt;stronggt;Lưu ýlt;/stronggt;: Nếu gặp lỗi quyền hạn, hãy thêm lt;code inline=quot;quot;gt;--userlt;/codegt; hoặc chạy với lt;code inline=quot;quot;gt;sudolt;/codegt; (trên Linux/macOS):lt;/pgt;
lt;pregt;lt;code class=quot;language-bashquot;gt;lt;span style=quot;background-color: black; color: #f3f3f3;quot;gt;lt;bgt;python -m pip install --upgrade pip --userlt;/bgt;lt;/spangt;
lt;/codegt;lt;/pregt;
lt;pgt;Hoặc:lt;/pgt;
lt;pgt;lt;span style=quot;background-color: black; color: #f3f3f3;quot;gt;lt;bgt;sudo python -m pip install --upgrade piplt;/bgt;lt;/spangt;lt;/pgt;lt;pgt;lt;span style=quot;background-color: white;quot;gt;lt;br /gt;lt;/spangt;lt;/pgt;lt;pgt;lt;span style=quot;background-color: white;quot;gt;Ví dụ về Pandaslt;/spangt;lt;/pgt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;quot;gt;lt;div style=quot;line-height: 19px;quot;gt;lt;div style=quot;line-height: 19px;quot;gt;lt;divgt;lt;span style=quot;color: #c586c0;quot;gt;importlt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pandaslt;/spangt; lt;span style=quot;color: #c586c0;quot;gt;aslt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pdlt;/spangt;lt;/divgt;lt;divgt;lt;span style=quot;color: #c586c0;quot;gt;importlt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;oslt;/spangt;lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #6a9955;quot;gt;# 🔹 Dữ liệu mẫult;/spangt;lt;/divgt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;datalt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; {lt;span style=quot;color: #ce9178;quot;gt;#39;Tên#39;lt;/spangt;: [lt;span style=quot;color: #ce9178;quot;gt;#39;An#39;lt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;#39;Bình#39;lt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;#39;Chi#39;lt;/spangt;],lt;/divgt;lt;divgt; lt;span style=quot;color: #ce9178;quot;gt;#39;Tuổi#39;lt;/spangt;: [lt;span style=quot;color: #b5cea8;quot;gt;25lt;/spangt;, lt;span style=quot;color: #b5cea8;quot;gt;30lt;/spangt;, lt;span style=quot;color: #b5cea8;quot;gt;35lt;/spangt;],lt;/divgt;lt;divgt; lt;span style=quot;color: #ce9178;quot;gt;#39;Thành phố#39;lt;/spangt;: [lt;span style=quot;color: #ce9178;quot;gt;#39;Hà Nội#39;lt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;#39;HCM#39;lt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;#39;Đà Nẵng#39;lt;/spangt;]}lt;/divgt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pdlt;/spangt;.lt;span style=quot;color: #4ec9b0;quot;gt;DataFramelt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;datalt;/spangt;)lt;/divgt;lt;divgt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;) lt;span style=quot;color: #6a9955;quot;gt;# 🖨️ In DataFrame mẫult;/spangt;lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #6a9955;quot;gt;# 🔹 Kiểm tra thư mục làm việc hiện tạilt;/spangt;lt;/divgt;lt;divgt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #ce9178;quot;gt;quot;📂 Thư mục hiện tại:quot;lt;/spangt;, lt;span style=quot;color: #4ec9b0;quot;gt;oslt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;getcwdlt;/spangt;())lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #6a9955;quot;gt;# 🔹 Đường dẫn filelt;/spangt;lt;/divgt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;script_dirlt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;oslt;/spangt;.lt;span style=quot;color: #9cdcfe;quot;gt;pathlt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;dirnamelt;/spangt;(lt;span style=quot;color: #4ec9b0;quot;gt;oslt;/spangt;.lt;span style=quot;color: #9cdcfe;quot;gt;pathlt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;abspathlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;__file__lt;/spangt;))lt;/divgt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;file_pathlt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;oslt;/spangt;.lt;span style=quot;color: #9cdcfe;quot;gt;pathlt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;joinlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;script_dirlt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;quot;data.csvquot;lt;/spangt;)lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #6a9955;quot;gt;# 🔹 Đọc file CSV (nếu có)lt;/spangt;lt;/divgt;lt;divgt;lt;span style=quot;color: #c586c0;quot;gt;iflt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;oslt;/spangt;.lt;span style=quot;color: #9cdcfe;quot;gt;pathlt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;existslt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;file_pathlt;/spangt;):lt;/divgt;lt;divgt; lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pdlt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;read_csvlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;file_pathlt;/spangt;, lt;span style=quot;color: #9cdcfe;quot;gt;seplt;/spangt;lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;quot;;quot;lt;/spangt;, lt;span style=quot;color: #9cdcfe;quot;gt;dtypelt;/spangt;lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt;lt;span style=quot;color: #4ec9b0;quot;gt;strlt;/spangt;) lt;span style=quot;color: #6a9955;quot;gt;# ⚠️ Bỏ header=None để Pandas nhận diện tên cộtlt;/spangt;lt;/divgt;lt;divgt; lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #ce9178;quot;gt;quot;lt;/spangt;lt;span style=quot;color: #d7ba7d;quot;gt;\nlt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;📌 Xem 5 dòng đầu file data.csv:quot;lt;/spangt;)lt;/divgt;lt;divgt; lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;headlt;/spangt;())lt;/divgt;lt;br /gt;lt;divgt; lt;span style=quot;color: #6a9955;quot;gt;# ✅ Chuyển cột #39;Tuổi#39; sang số nguyên để tránh lỗi so sánhlt;/spangt;lt;/divgt;lt;divgt; lt;span style=quot;color: #c586c0;quot;gt;iflt;/spangt; lt;span style=quot;color: #ce9178;quot;gt;#39;Tuổi#39;lt;/spangt; lt;span style=quot;color: #dcdcaa;quot;gt;inlt;/spangt; lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #9cdcfe;quot;gt;columnslt;/spangt;:lt;/divgt;lt;divgt; lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;[lt;span style=quot;color: #ce9178;quot;gt;#39;Tuổi#39;lt;/spangt;] lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;pdlt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;to_numericlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;[lt;span style=quot;color: #ce9178;quot;gt;#39;Tuổi#39;lt;/spangt;], lt;span style=quot;color: #9cdcfe;quot;gt;errorslt;/spangt;lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;#39;coerce#39;lt;/spangt;)lt;/divgt;lt;divgt;lt;span style=quot;color: #c586c0;quot;gt;elselt;/spangt;:lt;/divgt;lt;divgt; lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #569cd6;quot;gt;flt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;quot;❌ LỖI: File #39;lt;/spangt;lt;span style=quot;color: #569cd6;quot;gt;{lt;/spangt;lt;span style=quot;color: #9cdcfe;quot;gt;file_pathlt;/spangt;lt;span style=quot;color: #569cd6;quot;gt;}lt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;#39; không tồn tại!quot;lt;/spangt;)lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #6a9955;quot;gt;# 🔹 Lưu file CSVlt;/spangt;lt;/divgt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;output_pathlt;/spangt; lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt; lt;span style=quot;color: #4ec9b0;quot;gt;oslt;/spangt;.lt;span style=quot;color: #9cdcfe;quot;gt;pathlt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;joinlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;script_dirlt;/spangt;, lt;span style=quot;color: #ce9178;quot;gt;quot;output.csvquot;lt;/spangt;)lt;/divgt;lt;divgt;lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;to_csvlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;output_pathlt;/spangt;, lt;span style=quot;color: #9cdcfe;quot;gt;indexlt;/spangt;lt;span style=quot;color: #d4d4d4;quot;gt;=lt;/spangt;lt;span style=quot;color: #569cd6;quot;gt;Falselt;/spangt;)lt;/divgt;lt;divgt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #569cd6;quot;gt;flt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;quot;lt;/spangt;lt;span style=quot;color: #d7ba7d;quot;gt;\nlt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;✅ Đã lưu file: lt;/spangt;lt;span style=quot;color: #569cd6;quot;gt;{lt;/spangt;lt;span style=quot;color: #9cdcfe;quot;gt;output_pathlt;/spangt;lt;span style=quot;color: #569cd6;quot;gt;}lt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;quot;lt;/spangt;)lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #6a9955;quot;gt;# 🔹 Lọc dữ liệu theo cột #39;Tên#39; và #39;Tuổi#39;lt;/spangt;lt;/divgt;lt;divgt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #ce9178;quot;gt;quot;lt;/spangt;lt;span style=quot;color: #d7ba7d;quot;gt;\nlt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;📊 Lọc dữ liệu theo cột Tên-Tuổi:quot;lt;/spangt;)lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #c586c0;quot;gt;iflt;/spangt; lt;span style=quot;color: #ce9178;quot;gt;quot;Tênquot;lt;/spangt; lt;span style=quot;color: #dcdcaa;quot;gt;inlt;/spangt; lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #9cdcfe;quot;gt;columnslt;/spangt;:lt;/divgt;lt;divgt; lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #ce9178;quot;gt;quot;lt;/spangt;lt;span style=quot;color: #d7ba7d;quot;gt;\nlt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;🔹 Cột Tên:quot;lt;/spangt;)lt;/divgt;lt;divgt; lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;[lt;span style=quot;color: #ce9178;quot;gt;quot;Tênquot;lt;/spangt;])lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #c586c0;quot;gt;iflt;/spangt; lt;span style=quot;color: #ce9178;quot;gt;quot;Tuổiquot;lt;/spangt; lt;span style=quot;color: #dcdcaa;quot;gt;inlt;/spangt; lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #9cdcfe;quot;gt;columnslt;/spangt;:lt;/divgt;lt;divgt; lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #ce9178;quot;gt;quot;lt;/spangt;lt;span style=quot;color: #d7ba7d;quot;gt;\nlt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;🔹 Danh sách người trên 28 tuổi:quot;lt;/spangt;)lt;/divgt;lt;divgt; lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;[lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;[lt;span style=quot;color: #ce9178;quot;gt;quot;Tuổiquot;lt;/spangt;] lt;span style=quot;color: #dcdcaa;quot;gt;gt;lt;/spangt; lt;span style=quot;color: #b5cea8;quot;gt;28lt;/spangt;])lt;/divgt;lt;br /gt;lt;divgt;lt;span style=quot;color: #6a9955;quot;gt;# 🔹 Thống kê dữ liệult;/spangt;lt;/divgt;lt;divgt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #ce9178;quot;gt;quot;lt;/spangt;lt;span style=quot;color: #d7ba7d;quot;gt;\nlt;/spangt;lt;span style=quot;color: #ce9178;quot;gt;📈 Thống kê dữ liệu:quot;lt;/spangt;)lt;/divgt;lt;divgt;lt;span style=quot;color: #dcdcaa;quot;gt;printlt;/spangt;(lt;span style=quot;color: #9cdcfe;quot;gt;dflt;/spangt;.lt;span style=quot;color: #dcdcaa;quot;gt;describelt;/spangt;())lt;/divgt;lt;/divgt;lt;/divgt;lt;/divgt;lt;divgt;lt;br /gt;lt;/divgt;Nội dung file lt;span style=quot;color: #990000;quot;gt;lt;bgt;data.csvlt;/bgt;lt;/spangt;(cùng thư mục)lt;divgt;lt;br /gt;lt;div style=quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, quot;Courier Newquot;, monospace; font-size: 14px; line-height: 19px; white-space: pre;quot;gt;lt;divgt;Tên;Tuổi;Thành phốlt;/divgt;lt;divgt;An;lt;span style=quot;color: #b5cea8;quot;gt;25lt;/spangt;;Hà Nộilt;/divgt;lt;divgt;Bình;lt;span style=quot;color: #b5cea8;quot;gt;30lt;/spangt;;HCMlt;/divgt;lt;divgt;Chi;lt;span style=quot;color: #b5cea8;quot;gt;35lt;/spangt;;Đà Nẵnglt;/divgt;lt;/divgt;lt;p style=quot;text-align: right;quot;gt;lt;span style=quot;color: white;quot;gt;lt;i style=quot;background-color: black;quot;gt;Made by AIlt;/igt;lt;/spangt;lt;/pgt;lt;/divgt;