Data Engineering เบื้องต้น
Vincent Vankrunkelsven
Data Engineer @ DataCamp
พื้นฐานของเครื่องมือประมวลผลข้อมูลยุคใหม่
แนวคิด


การบริหารร้านตัดเสื้อ
เป้าหมาย: เสื้อ 100 ตัว
ช่างหลายคนทำงานร่วมกัน > ช่างที่ดีที่สุดคนเดียว
แรม (RAM memory chip):

ค่าใช้จ่ายส่วนเกินจากการสื่อสาร
Parallel slowdown:


multiprocessing.Pool
from multiprocessing import Pooldef take_mean_age(year_and_group): year, group = year_and_group return pd.DataFrame({"Age": group["Age"].mean()}, index=[year])with Pool(4) as p: results = p.map(take_mean_age, athlete_events.groupby("Year"))result_df = pd.concat(results)
dask
import dask.dataframe as dd# Partition dataframe into 4 athlete_events_dask = dd.from_pandas(athlete_events, npartitions = 4)# Run parallel computations on each partition result_df = athlete_events_dask.groupby('Year').Age.mean().compute()
Data Engineering เบื้องต้น