# Python Analytics - การวิเคราะห์ขั้นสูงและ ML (Data Analytics) > groupby, merge, pivot_table, apply/map, Plotly, Scikit-Learn (regression, classification, clustering), train/test split, เมตริก, Jupyter, Google Colab - 20 คำถามสัมภาษณ์ - Senior - [คำถามสัมภาษณ์: Data Analytics](https://sharpskill.dev/th/technologies/data-analytics/interview-questions.md) ## 1. ความแตกต่างหลักระหว่างเมธอด apply() และ map() บน Pandas Series คืออะไร? **คำตอบ** เมธอด map() ถูกออกแบบมาเพื่อจับคู่แต่ละค่าใน Series ไปยังค่าใหม่โดยใช้ dictionary หรือฟังก์ชัน และทำงานเฉพาะบน Series เท่านั้น ในทางตรงกันข้าม apply() มีความยืดหยุ่นมากกว่า: สามารถนำฟังก์ชันไปใช้ทีละองค์ประกอบบน Series หรือทีละแถว/คอลัมน์บน DataFrame สำหรับการแปลงค่าต่อค่าอย่างง่ายบน Series นั้น map() มักจะเร็วกว่าและอ่านง่ายกว่า ## 2. ควรใช้เมธอด Pandas ใดเพื่อรวมข้อมูลด้วยฟังก์ชันการรวมหลายฟังก์ชันบนคอลัมน์ต่างๆ พร้อมกัน? **คำตอบ** เมธอด agg() (หรือ aggregate()) อนุญาตให้ใช้ฟังก์ชันการรวมที่แตกต่างกันกับคอลัมน์ที่แตกต่างกันในการดำเนินการเดียว มันยอมรับ dictionary ที่ key เป็นชื่อคอลัมน์และ value เป็นฟังก์ชันที่จะใช้ วิธีนี้มีประสิทธิภาพและอ่านง่ายกว่าการเชื่อมโยงการเรียก groupby หลายครั้งด้วยฟังก์ชันแต่ละรายการ ## 3. ความแตกต่างระหว่าง merge() และ join() ใน Pandas คืออะไร? **คำตอบ** merge() เป็นฟังก์ชันที่ยืดหยุ่นกว่าซึ่งรวมสอง DataFrame บนคอลัมน์เฉพาะโดยใช้พารามิเตอร์ on, left_on/right_on หรือ indexes ส่วน join() เป็นเมธอด DataFrame ที่รวมบน indexes โดยค่าเริ่มต้นและกระชับกว่าสำหรับการรวมตาม index แบบง่าย สำหรับการรวมที่ซับซ้อนบนคอลัมน์ที่ไม่ใช่ index นั้น merge() เป็นที่นิยมกว่าเพราะให้การควบคุมคอลัมน์รวมมากกว่า ## มีอีก 17 คำถาม - จะสร้าง pivot table ด้วย pivot_table() โดยระบุฟังก์ชันการรวมหลายฟังก์ชันได้อย่างไร? - วัตถุประสงค์ของ transform() ในบริบท groupby() เปรียบเทียบกับ apply() คืออะไร? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ Data Analytics อื่นๆ - [Google Sheets - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/google-sheets-basics.md): 20 คำถาม, Junior - [Google Sheets - สูตรขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/google-sheets-advanced.md): 20 คำถาม, Junior - [SQL - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-basics.md): 25 คำถาม, Junior - [SQL - การรวมและการจัดกลุ่ม](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-aggregations.md): 20 คำถาม, Junior - [SQL - Joins](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-joins.md): 20 คำถาม, Junior - [BigQuery - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/bigquery-fundamentals.md): 20 คำถาม, Junior - [Data Cleaning - การทำความสะอาดข้อมูล](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/data-cleaning.md): 20 คำถาม, Junior - [KPI และเมตริกทางธุรกิจ](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/kpis-metrics.md): 20 คำถาม, Junior - [สถิติเชิงพรรณนา](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/descriptive-statistics.md): 20 คำถาม, Junior - [Zapier และระบบอัตโนมัติ No-Code](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/zapier-automation.md): 20 คำถาม, Junior - [หลักการ Data Visualization](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/data-viz-principles.md): 20 คำถาม, Junior - [Python & Pandas - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/python-pandas-basics.md): 20 คำถาม, Junior - [Google Sheets - แดชบอร์ดอัตโนมัติ](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/google-sheets-dashboards.md): 20 คำถาม, Mid-Level - [SQL - Subquery และ CTE](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-subqueries-ctes.md): 20 คำถาม, Mid-Level - [SQL - Window Functions](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-window-functions.md): 20 คำถาม, Mid-Level - [BigQuery - ฟีเจอร์ขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/bigquery-advanced.md): 20 คำถาม, Mid-Level - [Data Modeling](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/data-modeling.md): 20 คำถาม, Mid-Level - [การวิเคราะห์ Funnel และ Conversion](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/funnel-analysis.md): 20 คำถาม, Mid-Level - [การวิเคราะห์ Cohort และ Retention](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/cohort-retention.md): 20 คำถาม, Mid-Level - [Google Tag Manager และการติดตาม](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/gtm-tracking.md): 20 คำถาม, Mid-Level - [API และ Webhook](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/apis-webhooks.md): 20 คำถาม, Mid-Level - [dbt - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/dbt-fundamentals.md): 20 คำถาม, Mid-Level - [AB Testing และสถิติประยุกต์](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/ab-testing.md): 20 คำถาม, Mid-Level - [Looker Studio (Google Data Studio)](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/looker-studio.md): 20 คำถาม, Mid-Level - [Power BI - พื้นฐาน](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/power-bi-fundamentals.md): 20 คำถาม, Mid-Level - [SQL - การคิวรีเชิงวิเคราะห์ขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/sql-advanced-analytics.md): 20 คำถาม, Senior - [dbt - ฟีเจอร์ขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/dbt-advanced.md): 20 คำถาม, Senior - [Power BI - DAX และแดชบอร์ดขั้นสูง](https://sharpskill.dev/th/technologies/data-analytics/interview-questions/power-bi-dax.md): 20 คำถาม, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/th/technologies/data-analytics/interview-questions/python-analytics-advanced