列数の範囲に関する Expectation を設定する
この演習では、Renewable Power Generation データセットの列数に関する Expectation を作成します。列数は変動してもかまいませんが、常に16の前後であるべきだとします。
Renewable Power Generation データセットはすでに Batch に読み込まれており、変数 batch に割り当てられています。Great Expectations と pandas はそれぞれ gx と pd として利用できます。
この演習はコースの一部です
Great Expectationsで始めるデータ品質入門
演習の手順
- データセットの列数が16±2(16の前後2)になるという Expectation を作成してください。
- Expectation を検証してください。
- Expectation の成功ステータスと、実際の列数を出力してください。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# 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(____.____)