Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Introduction to Data Quality with Great Expectations

Cursus bekijken

Oefeninstructies

  • 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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create the Expectation
col_count_expectation = gx.expectations.____(
  min_value=____, ____=____
)

# Validate the Expectation
validation_results = batch.____(
  expect=____
)

# Print out the success status
print(____.____)

# Print out the actual column count
print(____.____)
Code bewerken en uitvoeren