def remove_var_with_one_value(df):
    """
    Removes dataset's columns that only contain one unique value.

    Parameters
    ----------
    df: pd.DataFrame
        Dataframe to inspect

    Returns
    -------
    pd.DataFrame:
        Dataframe without columns with only one unique value
    """
    if len(df) <= 1:
        return df
    drop_cols = list()
    for var in df:
        if df[var].nunique() <= 1:
            drop_cols.append(var)
    return df.drop(columns=drop_cols)
