開始使用免費開始

建立欄數 Expectation

在上一支影片中,我們學到用於表格列數的 ExpectTableRowCountToEqual(value: int) Expectation。正如影片結尾所示,Great Expectations 也有一個名為 ExpectTableColumnCountToEqual(value: int) 的 Expectation。這個類別的用途完全一樣,只是它套用在欄數,而不是列數。本練習中,你會實作這個類別,建立並驗證一個欄數的 Expectation。

你會使用與影片中相同的 Renewable Power Generation 資料集。想進一步了解這個資料集,請見此處的說明:here

資料集已載入為一個 Batch,並指定給變數 batch。Great Expectations 與 pandas 分別可用 gxpd 存取。

本練習屬於課程

Great Expectations 資料品質入門

檢視課程

動手互動練習

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


# Create table column count Expectation
expectation = gx.expectations.____(
	value=____
)
編輯並執行程式碼