<jupyter_start><jupyter_text>1.0 Validation Check Here we present how to use these two functions meant to validate a numeric variable, considering both, its type (it must be a numerical type) and its range of values.  1.1 Import modules<jupyter_code>#Check number
from gumly.value_validation import check_number

#Assert
from gumly.value_validation import assert_check_number
from gumly.value_validation import assert_check_dtypes


#Dtypes

from gumly.value_validation import check_dtypes

#Other
import pandas as pd<jupyter_output><empty_output><jupyter_text>1.2 Check Number  This function returns True if the first argument is a number and it lies between the next two arguments. Othwerise, returns False.<jupyter_code>check_number(x=1,lower=0, upper=100) # True
check_number(x=-1, lower=0, upper=100) # False<jupyter_output><empty_output><jupyter_text>1.3  Assert Check Number  This function uses the above function and it will raise an exception if check_number returns False.<jupyter_code>#error
lower_percentil = -1

assert_check_number(x=lower_percentil, lower=0, upper=1.0, varname="lower_percentil")<jupyter_output><empty_output><jupyter_text>1.4  Check_dtypes  This function will error if the list of types has no items.<jupyter_code>x = pd.DataFrame({'a': [1,2,3], 'b': ['1','2','3']})
y = pd.DataFrame({'a': [1,2,3], 'b': [1.0,1.2,3.0]})
x
check_dtypes(x, [])<jupyter_output><empty_output><jupyter_text>1.5  Assert_check_dtypes<jupyter_code>assert_check_dtypes(y, ['object'])
assert_check_dtypes(y, ['float64'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10803858520900321, 'fraction_numerical': 0.02765273311897106, 'mean_word_length': 7.410810810810811, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '601685', 'license': 'Apache-2.0', 'n_tokens_mistral': 550, 'n_tokens_neox': 536, 'n_words': 144, 'path': 'exercises/value_validation.ipynb', 'repo_name': 'GAVB-SERVICOS/Gumly', 'size': '1555'}