def extract_cm_values(df, grp):
    """Extracts TP, TN, FP and TN from long format confusion matrix

    Args: 
        df (Dataframe): confusion matrix as returned 
                        by :meth:`Bias.Balancer.get_confusion_matrix()`
        grp (str): name of sensitive group to retrieve matrix from 
    
    Returns: 
        tuple: Tuple with elements *TP* (true positives), *FN* (false negatives)*FP* (false positives), *TN* (true negatives).
    """
    cm_data = df.query(f"a=='{grp}'").set_index('type_obs')
    TP = cm_data.at['TP', 'number_obs']
    FN = cm_data.at['FN', 'number_obs']
    FP = cm_data.at['FP', 'number_obs']
    TN = cm_data.at['TN', 'number_obs']

    return TP, FN, FP, TN