def detect_type(data):
    """
    @author : Ilyas BENGHABRIT
    Detecting the type of the variables numerical or categorical

    Args: 
        :param data: The dataset.
        :type  data: pandas.DataFrame
            
    Returns: 
        :param num_variables: List of columns with numerical values.
        :type num_variables: list
        
        :param categ_variables: List of columns with categorical values.
        :type categ_variables: list
    """
    
    num_variables = []
    categ_variables = []
    columns = list(data.columns)
    n = len(columns)
    for i in range(n):
        if data[columns[i]].dtype in  ['int32','int64','float32','float64','int','float']: #Checking if the variable is numerical
            num_variables.append(columns[i])
        else : 
            categ_variables.append(columns[i])
    return num_variables, categ_variables