def _extract_offer_spendings(transcript_group):
    """Extracts the spendings per customer

    Args:
        transcript_group (pandas.DataFrame): The transcript dataset
    
    Returns:
        pandas.DataFrame: The modified transcript with the spendings per customer extracted
    """

    transcript_group["recommended_offer"] = transcript_group.apply(lambda x: 0 if x.purchased == False else x.mapped_offer, axis=1).astype(int)
    transcript_group["spendings"] = transcript_group.apply(lambda x: x.amount + x.non_offer_amount, axis=1)

    return transcript_group