Toplam düzeyinde Expectation'lar oluştur
Toplam (aggregate) düzeyde, sütuna özel bazı Expectation'lar yazma zamanı. Expectation Suite ve Batch sırasıyla suite ve batch değişkenlerine atanmış durumda ve Shein Footwear veri kümesiyle yüklendi. Great Expectations ve pandas sırasıyla gx ve pd olarak kullanılabilir.
Bu egzersiz, kursun bir parçasıdır
Great Expectations ile Veri Kalitesine Giriş
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
# "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=____
)