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

Connected

Exercise

Establish numeric Expectations

In this exercise, you'll practice establishing and validating some numeric-type Expectations, both at the aggregate- and row-levels. As you go through each of these Expectations, think about whether or not this is an Expectation you would write for this particular dataset. Is this a reasonable thing to expect of the data? Do you expect the Validation Result to be successful?

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/4

undefined XP
  • 1
    • Print out the first few rows of the DataFrame to get familiar with the data.
  • 2
    • Create an Expectation for the median value of the "star_rating" column be between 2 and 4.
    • Validate your Expectation.
  • 3
    • Create an Expectation that each value of the "star_rating" column be between 1 and 5.
    • Validate your Expectation.
  • 4
    • Create an Expectation that the values of the "star_rating" column be increasing.
    • Validate your Expectation.