เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

สร้าง Expectations ระดับ Aggregate

ถึงเวลาฝึกเขียน Expectations เฉพาะคอลัมน์ในระดับ Aggregate แล้ว Expectation Suite และ Batch ถูกกำหนดให้กับตัวแปร suite และ batch ตามลำดับ และโหลดด้วยชุดข้อมูล Shein Footwear เรียบร้อยแล้ว Great Expectations และ pandas พร้อมใช้งานในชื่อ gx และ pd ตามลำดับ

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# "colour" should be in the set "Khaki", "Purple", or "Grey"
colour_expectation = gx.expectations.ExpectColumnDistinctValuesToBeInSet(
    ____="colour", value_set={"Khaki", "Purple", "Grey"}
)

# "seller_name" should have 7 to 10 distinct values
seller_expectation = gx.expectations.ExpectColumnUniqueValueCountToBeBetween(
    column="seller_name", ____=7, ____=10
)

# "link" should have all unique values
link_expectation = gx.expectations.____(
    column="link"
)

# "review_count" should have a most common value in the set "0" or "100+"
review_count_expectation = gx.expectations.ExpectColumnMostCommonValueToBeInSet(
    column=____, value_set=____
)
แก้ไขและรันโค้ด