.. 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_string_length_out_of_bounds.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_string_length_out_of_bounds.py: .. _plot_tabular_string_length_out_of_bounds: String Length Out Of Bounds *************************** This notebook provides an overview for using and understanding the String Length Out Of Bounds check. **Structure:** * `What is String Length Out Of Bounds <#what-is-string-length-out-of-bounds>`__ * `Generate data <#generate-data>`__ * `Run the check <#run-the-check>`__ .. GENERATED FROM PYTHON SOURCE LINES 18-22 What is String Length Out Of Bounds ====================================== The ``StringLengthOutOfBounds`` check detects strings with length that is much longer/shorter than the identified "normal" string lengths. .. GENERATED FROM PYTHON SOURCE LINES 24-29 .. code-block:: default import pandas as pd from deepchecks.tabular.checks import StringLengthOutOfBounds from deepchecks.tabular import Dataset .. GENERATED FROM PYTHON SOURCE LINES 30-32 Generate Data =============== .. GENERATED FROM PYTHON SOURCE LINES 32-46 .. code-block:: default col1 = ["deepchecks123", "deepchecks456"]*40 col1.append("ab") col1.append("cd") col2 = ["b", "abc"]*41 col3 = ["deepchecks"]*80 col3.append("an_outlier") col3.append("im_an_outlier_too") ## col1 and col3 contain outliers, col2 does not df = pd.DataFrame({"col1":col1, "col2": col2, "col3": col3 }) df = Dataset(df, cat_features=[]) .. GENERATED FROM PYTHON SOURCE LINES 47-49 Run the check ================ .. GENERATED FROM PYTHON SOURCE LINES 49-52 .. code-block:: default StringLengthOutOfBounds().run(df) .. raw:: html
String Length Out Of Bounds


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