.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tabular/auto_checks/data_integrity/plot_percent_of_nulls.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_tabular_auto_checks_data_integrity_plot_percent_of_nulls.py: .. _tabular__percent_of_nulls: Percent Of Nulls **************** This notebook provides an overview for using the Percent Of Nulls check. **Structure:** * `What is Percent Of Nulls <#what-are-percent-of-nulls>`__ * `Generate data <#generate-data>`__ * `Run the check <#run-the-check>`__ * `Define a condition <#define-a-condition>`__ What is Percent Of Nulls =========================== The ``PercentOfNulls`` check calculates percent of ``null`` values for each column and displays the result as a bar chart. .. GENERATED FROM PYTHON SOURCE LINES 26-28 Generate data =============== .. GENERATED FROM PYTHON SOURCE LINES 28-34 .. code-block:: default import numpy as np import pandas as pd from deepchecks.tabular.checks.data_integrity import PercentOfNulls df = pd.DataFrame({'foo': [1, 2, None, np.nan], 'bar': [None, 1, 2, 3]}) .. GENERATED FROM PYTHON SOURCE LINES 35-37 Run the Check ================ .. GENERATED FROM PYTHON SOURCE LINES 37-40 .. code-block:: default result = PercentOfNulls().run(df) result.show() .. raw:: html
PercentOfNulls


.. GENERATED FROM PYTHON SOURCE LINES 41-43 Define a Condition ===================== .. GENERATED FROM PYTHON SOURCE LINES 43-47 .. code-block:: default df = pd.DataFrame({'foo': [1, 2, None, np.nan], 'bar': [None, 1, 2, 3]}) check = PercentOfNulls().add_condition_percent_of_nulls_not_greater_than() result = check.run(df) result.show() .. raw:: html
PercentOfNulls


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.178 seconds) .. _sphx_glr_download_tabular_auto_checks_data_integrity_plot_percent_of_nulls.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_percent_of_nulls.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_percent_of_nulls.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_