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

Connected

Exercise

Write up a Conditional Expectation

Taking a look at the Shein dataset, you can probably come up with a few Conditional Expectations. One such Expectation could be that the star_rating of a product should be 0.0 if the product has no reviews. Let's practice establishing this Conditional Expectation.

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
    2
  • Establish an Expectation that all values in the star_rating column should equal 0.0 for rows with a review_count of 0.