PY-2: pandas Basics
pandas Basics
Section titled “pandas Basics”pandas คือ library หลักสำหรับจัดการข้อมูลใน Python บทนี้จะพาคุณเริ่มต้นจากการอ่านไฟล์ CSV ไปจนถึงการเลือกและกรองข้อมูลอย่างมีประสิทธิภาพ
- เข้าใจความแตกต่างระหว่าง Series และ DataFrame
- ใช้ .shape, .dtypes, .info() ตรวจสอบโครงสร้างข้อมูล
- อ่านไฟล์ CSV ด้วย pd.read_csv() พร้อมกำหนด dtype และ na_values
- เลือกและกรองข้อมูลด้วย boolean masks, .loc และ .iloc
Progress 0 / 4
เนื้อหาในบทนี้
Section titled “เนื้อหาในบทนี้” 01 — Series & DataFrame โครงสร้างข้อมูลหลักของ pandas
02 — Reading CSV pd.read_csv() พร้อม dtype, na_values, parse_dates
03 — Selecting & Filtering df['col'], boolean masks, .loc/.iloc
Lab: Explore Dataset ฝึกปฏิบัติ — สำรวจข้อมูลจริงด้วย pandas
ทำไมต้อง pandas?
Section titled “ทำไมต้อง pandas?”| ความสามารถ | Excel | pandas |
|---|---|---|
| จำนวนแถวสูงสุด | ~1 ล้าน | ไม่จำกัด (ตาม RAM) |
| ทำซ้ำได้ | ยาก | เขียน script ได้ |
| Version control | ไม่ได้ | ใช้ Git ได้ |
| ความเร็ว | ช้าเมื่อข้อมูลเยอะ | เร็วกว่ามาก |