😫 Vấn đề (The Pain Point)
Danh sách khách hàng 10.000 dòng có nhiều người đăng ký 2-3 lần. Excel có nút “Remove Duplicates” nhưng nó xóa mất tiêu, bạn không biết nó xóa ai. Bạn muốn giữ lại danh sách bị xóa để kiểm tra.
🚀 Giải pháp Agentic (The Solution)
Tool lọc trùng thông minh: Tách riêng danh sách “Sạch” và danh sách “Trùng” ra 2 sheet khác nhau.
Tính năng:
- Custom Key: Lọc trùng theo SĐT, hoặc Email, hoặc cả hai.
- Audit Trail: Không xóa mất dữ liệu, chỉ phân loại.
- Keep Last/First: Chọn giữ lại người đăng ký mới nhất hay cũ nhất.
🤖 Engineering Prompt (Copy & Paste)
**Role:** Python Data Analyst
**Task:** Create a "Smart Excel Deduplicator".
**Requirements:**
1. **Tech Stack:** Python, `tkinter`, `pandas`.
2. **GUI:**
* Select Excel File.
* Select "Key Column" (from dropdown of columns found in file).
* Option: "Keep First" or "Keep Last".
* "Process" button.
3. **Logic:**
* Load Excel.
* Identify duplicates: `df[df.duplicated(subset=Key, keep=False)]`.
* Split into `Clean_Data` and `Removed_Duplicates`.
* Save to new Excel with 2 Sheets.
4. **Deliverables:**
* `excel_dedup.py`
* `run.bat`
* `requirements.txt`
**Context:** Cleaning customer lists (CRM) before marketing campaigns.
🧠 Giải mã Prompt
- 2 Sheets Output: Yêu cầu output ra 2 sheet giúp user an tâm tuyệt đối vì họ có thể kiểm chứng lại những gì tool đã “lọc” bỏ.
🛠️ Hướng dẫn
- Copy Prompt -> Paste -> Chạy.
- Chọn File -> Chọn cột “Số điện thoại” -> Process.