Создание агрегированных 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=____
)