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

Connected

Exercise

Establish a Column Range Expectation

In this exercise, you'll be writing an Expectation regarding the column count of the Renewable Power Generation dataset. Suppose the number of columns can change, but it should always stay in an interval around 16.

The Renewable Power Generation dataset has already been loaded into a Batch, assigned to the variable batch. Great Expectations and pandas are available as gx and pd, respectively.

Instructions

100 XP
  • Write an Expectation that the column count of the dataset should be around 16, plus or minus 2.
  • Validate your Expectation.
  • Print out the success status of the Expectation, as well as the actual column count.