def make_categories(df):
    """
    A convenience function to set object types to category variables

    Parameters:
    -----------
    df: pandas dataframe

    Returns:
    -------
    df: with object types set as category variables

    """
    for col in df.select_dtypes(include="object").columns:
        df[col] = df[col].astype("category")
    return df