집계 수준 Expectations 설정하기
이제 열별 Expectations를 집계 수준에서 작성해 보세요. 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=____
)