def drop_quasi_zero(df, thresh=0.05):
    """
    Drop Quasi Zero Features

    Returns a passed pandas DataFrame without columns containing too few
    non-zero values.

    Parameters
    ----------
    df : pandas DataFrame
        Dataset whose columns will be dropped.
    thresh : float, optional
        Minimum percentage of non-zero values in any given column for it to be
        kept in the dataset. Default value is 0.05.

    Returns
    -------
    pandas DataFrame
    """
    drop_list = []
    for el in df.columns.values:
        non_zero = df[el][df[el] != 0].shape[0] / df.shape[0]
        if non_zero < thresh:
            drop_list.append(el)
            print('Dropping column: {} | Non-zero values ratio: {}%'.format(
                el, round(100 * non_zero, 3)))
    return df.drop(drop_list, axis=1)