สำหรับ Blog นี้คิดสว่าน่าจะสั้นนะครับ เพราะเหมือนเป็นการ Reference Blog อีกทีมากกว่า สำหรับสัปดาห์นี้มีเรียน 4 เรื่องครับ หัวข้อตามนี้เลย
📌Python OOP
อันนี้ขอแชร์ตัว List ที่เคยไปเรียนมาเมื่อหลายปีก่อนแทนครับ
หัวข้อที่เกี่ยวข้อง
- [MITx: 6.00.1x] Week 1: Intro to Python Primitive Data Type / if-else / IO / Function
- [MITx: 6.00.1x] Week 2: Approximate Solutions & Bisection Search + Problem Solving
- [MITx: 6.00.1x] Week 3: Structure Type / Side Effect
- [MITx: 6.00.1x] Week 4: Testing & Debugging & Assertion
- [MITx: 6.00.1x] Week 5: Type Hint / Lambda / Object Oriented Programming
- [MITx: 6.00.1x] Week 6: Algorithm + Big O
- [MITx: 6.00.1x] Week 7: Simple Plot
📌Numpy 101
ตาม Blog เลยครับ
📌Pandas 101
อันนี้มี Blog เขียนไว้แล้วครับ
📌Request 101
สำหรับ Python แล้ว เวลายิง Request ไปดึงข้อมูลจะมี Package มาตรฐานมาให้แล้ว ดังนี้
import requests
การดึงข้อมูลมี Public API หลายตัว เอาจากใน Repo นี้ก็ได้ https://github.com/public-apis/public-apis มันจะบอกหมด เปิด Free หรือ ต้องขอ Token
import requests
import time
url = "https://swapi.dev/api/people/"
name = []
height = []
masses = []
for i in range(5):
print(url + str(i+1))
resp = requests.get(url + str(i))
if resp.status_code == 200:
# print(resp.json())
name.append(resp.json()['name'])
height.append(resp.json()['height'])
masses.append(resp.json()['mass'])
time.sleep(1)
else:
print("Error")
print(name)
print(height)
print(masses)มุมของ Data Analyst การ Get ข้อมูลมาประกอบกัน แล้วไปหา Insight ต่อ อย่างตัวนี้ใช้ Panda ครับ
# create simple data frame from name height masses
import pandas as pd
df = pd.DataFrame({
'name': name,
'height': height,
'mass': masses
})
df
สำหรับ Verb อื่นๆ Post / Put ลองดูหัวข้อแรกใน Blog นี้ได้ครับ [KBTG-GO#04] API Design
Discover more from naiwaen@DebuggingSoft
Subscribe to get the latest posts sent to your email.



