def drop_irrelevant_columns_with_data_schema(dfx, data_schema):
    """

    :param dfx (dataframe): df containing irrelevant columns
    :param data_schema (dictionary): data schema containing distinction between relevant and irrelevant columns
    :return dfx (dataframe): df containing only relevant columns
    """


    ## Creating a list of the relevant columns
    rc = [
        data_schema[col]["clean_col_name"]
        for col in data_schema
        if data_schema[col]["relevant"]
    ]

    ## Dropping selected columns
    dfx = dfx.loc[:, rc]


    return dfx