def trim_data(ps, common_support, data):
    """This function trims the data below and above the common support."""
    data_trim = data[(data.ps >= common_support[0]) & (data.ps <=
        common_support[1])]
    ps_trim = ps[(ps >= common_support[0]) & (ps <= common_support[1])]
    return data_trim, ps_trim
