.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "checks_gallery/tabular/data_integrity/plot_mixed_nulls.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_checks_gallery_tabular_data_integrity_plot_mixed_nulls.py: .. _plot_tabular_mixed_nulls: Mixed Nulls *********** This notebook provides an overview for using and understanding the Mixed Nulls check. **Structure:** * `What are Mixed Nulls <#what-are-mixed-nulls>`__ * `Generate data <#generate-data>`__ * `Run the check <#run-the-check>`__ .. GENERATED FROM PYTHON SOURCE LINES 18-21 What are Mixed Nulls ====================== The ``MixedNulls`` check search for various types of null values, including string representations of null. .. GENERATED FROM PYTHON SOURCE LINES 24-26 Imports ======= .. GENERATED FROM PYTHON SOURCE LINES 26-30 .. code-block:: default import pandas as pd from deepchecks.tabular.checks import MixedNulls .. GENERATED FROM PYTHON SOURCE LINES 31-33 Generate data =============== .. GENERATED FROM PYTHON SOURCE LINES 33-38 .. code-block:: default data = {'col1': ['sog', '1', 'cat', None, None]} dataframe = pd.DataFrame(data=data) .. GENERATED FROM PYTHON SOURCE LINES 39-41 Run the check =============== .. GENERATED FROM PYTHON SOURCE LINES 41-44 .. code-block:: default MixedNulls().run(dataframe) .. raw:: html
Mixed Nulls


.. GENERATED FROM PYTHON SOURCE LINES 45-46 We can also check for string representations of null: .. GENERATED FROM PYTHON SOURCE LINES 46-50 .. code-block:: default data = {'col1': ['nan', None, 'null', 'Nan', '1', 'cat'], 'col2':['', '', 'None', 'a', 'b', 'c'], 'col3': [1,2,3,4,5,6]} dataframe = pd.DataFrame(data=data) MixedNulls().run(dataframe) .. raw:: html
Mixed Nulls


.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.170 seconds) .. _sphx_glr_download_checks_gallery_tabular_data_integrity_plot_mixed_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_mixed_nulls.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_mixed_nulls.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_