การตรวจสอบคอลัมน์พื้นฐาน

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

Davina Moossazadeh

Data Scientist

ชุดข้อมูล Shein Footwear

5 แถวแรกของ Shein Footwear Dataset จาก Kaggle ที่โหลดลงใน pandas โดย DataFrame มีคอลัมน์ดังนี้: "name", "link", "price_usd", "mark_price_usd", "star_rating", "colour", "seller_name", "review_count", "sku_id" และ "hero_image"

1 https://www.kaggle.com/datasets/atharvataras/shein-footwear-dataset
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Row-level Expectations

  • Row-Level Expectations จะถูกใช้กับแต่ละแถวแยกกัน
    • ผ่านก็ต่อเมื่อเงื่อนไขเป็นจริงในทุกแถว
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Row-level Expectations

Missingness Expectation

gx.expectations.ExpectColumnValuesToNotBeNull(
    column="colour"
)

Type Expectation

gx.expectations.ExpectColumnValuesToBeOfType(
    column="review_count", type_="str"
)
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Aggregate-level Expectations: ค่าที่ไม่ซ้ำกัน

Distinct values Expectation

gx.expectations.ExpectColumnDistinctValuesToEqualSet(
    column="seller_name", value_set={"Womens Shoes"}
)
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Aggregate-level Expectations: จำนวนค่าที่ไม่ซ้ำ

Unique value count Expectation

gx.expectations.ExpectColumnUniqueValueCountToBeBetween(
    column="review_count", min_value=5, max_value=101
)
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Aggregate-level Expectations: ความเป็นเอกลักษณ์

Uniqueness Expectation

gx.expectations.ExpectColumnValuesToBeUnique(
    column="sku_id"
)
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Aggregate-level Expectations: ฐานนิยม

Mode Expectation

gx.expectations.ExpectColumnMostCommonValueToBeInSet(
    column="colour", value_set={"Khaki", "Purple", "Grey"}
)
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

สรุปย่อ

Row-level Expectations:

ExpectColumnValuesToNotBeNull(
    column: str
)
ExpectColumnValuesToBeOfType(
    column: str, type_: str
)

Aggregate-level Expectations:

ExpectColumnDistinctValuesToEqualSet(
    column: str, value_set: set
)
ExpectColumnUniqueValueCountToBeBetween(
    column: str, 
    min_value: int, max_value: int
)
ExpectColumnValuesToBeUnique(column: str)
ExpectColumnMostCommonValueToBeInSet(
    column: str, value_set: set
)
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

มาฝึกกันเถอะ!

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

Preparing Video For Download...