sebaba/utils.py
def drop_missing_var(df = None, threshold = 0.8):
    """
    Function that removes variables that have missing percentages above a threshold.
    
    Parameters:
    --------------------------------------------------
        df       : DataFrame
        threshold: float, the threshold for missing percentage value in decimals

    Returns:
    --------------------------------------------------
        df: Pandas DataFrame with variables removed
    """

    remove = df.columns[df.isnull().mean() > threshold].to_list()
    df     = df.drop(remove, axis = 1)

    return df

    Function that removes variables that have missing percentages above a threshold.
    
    Parameters:
    --------------------------------------------------
        df       : DataFrame
        threshold: float, the threshold for missing percentage value in decimals

    Returns:
    --------------------------------------------------
        df: Pandas DataFrame with variables removed
    
Function that removes variables that have missing percentages above a threshold.
Function that removes variables that have missing percentages above a threshold .
def drop_missing_var(df = None, threshold = 0.8):
    remove = df.columns[df.isnull().mean() > threshold].to_list()
    df     = df.drop(remove, axis = 1)
    return df
def drop_missing_var ( df = None , threshold = 0.8 ) : remove = df . columns [ df . isnull ( ) . mean ( ) > threshold ] . to_list ( ) df = df . drop ( remove , axis = 1 ) return df
Function that removes variables that have missing percentages above a threshold.
Function that removes variables that have missing percentages above a threshold .
"""
    Function that removes variables that have missing percentages above a threshold.
    
    Parameters:
    --------------------------------------------------
        df       : DataFrame
        threshold: float, the threshold for missing percentage value in decimals

    Returns:
    --------------------------------------------------
        df: Pandas DataFrame with variables removed
    """
Pandas DataFrame with variables removed
Pandas DataFrame with variables removed
df
df
threshold
float, the threshold for missing percentage value in decimals
float the threshold for missing percentage value in decimals
df       
None