1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Quality with Great Expectations

Connected

Exercise

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.

Instructions 1/2

undefined XP
  • 1
    • Create and run an Expectation that all values in the star_rating column be equal to 0.0 for rows with null seller_name.
  • 2
    • Create and run an Expectation that all values in the seller_name column be null for rows with star_rating equal to 0.0.