BaşlayınÜcretsiz Başlayın

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.

Bu egzersiz

Introduction to Data Quality with Great Expectations

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# 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(____.____)
Kodu Düzenle ve Çalıştır