Aan de slagGa gratis aan de slag

Invert a Conditional Expectation

It's important to keep in mind that, as with conditional probability, Conditional Expectations are not necessarily equal to their inverse. An Expectation of Column A conditional on Column B might succeed, but its inverse may not. Let's explore that in this exercise.

A Batch connected to the Shein Footwear dataset has already been created and assigned to the variable batch. Great Expectations and pandas are available as gx and pd, respectively.

Deze oefening maakt deel uit van de cursus

Introduction to Data Quality with Great Expectations

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Establish Conditional Expectation
expectation = gx.expectations.ExpectColumnValuesToBeInSet(
    column=____,
    value_set=____,
    condition_parser='pandas',
    row_condition='____.isnull()',
)

# Run Expectation
results = batch.____(____=____)

# Print success status
print(results.success)
Code bewerken en uitvoeren