def prune_dataframe(df, columns, drop_allps=True):
    """
    Keeps only specified columns.
    Drops duplicates and missing data.
    """
    new_df = df.copy()
    if drop_allps:
        new_df = new_df.loc[new_df.content_audience != 'allps']
    return new_df[columns].dropna().drop_duplicates()