def extract_FC_raw(df, rec):
    """
    Extract the Frequency and Consistency features from transactions df.

    Args:
        df : dataframe with column 'TRANSACTION_DATE' containing the bill payment dates
        rec : Q if quarterly bill, M if monthly bill

    Returns:
        F_raw : average days bet payments minus the expected pattern
        C_raw : standard deviation of the distribution of days bet payments
    """
    df = df.sort_values('TRANSACTION_DATE')
    diff = (df['TRANSACTION_DATE'] - df['TRANSACTION_DATE'].shift(1)).iloc[1:]
    if rec == 'M':
        pattern = 30
    elif rec == 'Q':
        pattern = 90
    F_raw = diff.mean().days - pattern
    C_raw = diff.std().days
    return F_raw, C_raw
