Definește Expectations la nivel de agregare
E momentul să exersezi scrierea unor Expectations specifice coloanelor la nivel de agregare. Expectation Suite și Batch au fost deja atribuite variabilelor suite și, respectiv, batch, și încărcate cu setul de date Shein Footwear. Great Expectations și pandas sunt disponibile ca gx și, respectiv, pd.
Acest exercițiu face parte din cursul
Introducere în calitatea datelor cu Great Expectations
Exercițiu interactiv practic
Încearcă acest exercițiu completând acest cod de exemplu.
# "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=____
)