開始使用免費開始

在「檢查點」驗證資料管線

在這個練習中,你將操作一個資料管線:它會從 CSV 檔案擷取稅務資料、新增一個欄位、依平均應稅所得篩選列,並將資料寫入 parquet 檔。

已經將 pandas 載入為 pd,而 extract()transform()load() 這三個函式也都定義好了。你會使用這些函式,在管線執行過程中的多個檢查點驗證資料管線。

本練習屬於課程

使用 Python 的 ETL 與 ELT

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Extract and transform tax_data
raw_tax_data = extract("raw_tax_data.csv")
clean_tax_data = transform(raw_tax_data)

# Check the shape of the raw_tax_data DataFrame, compare to the clean_tax_data DataFrame
print(f"Shape of raw_tax_data: {raw_tax_data.____}")
print(f"Shape of clean_tax_data: {____}")
編輯並執行程式碼