def _extract_purchased(transcript_group):
    """Extracts the purchased column

    Args:
        transcript_group (pandas.DataFrame): The transcript dataset

    Returns:
        pandas.DataFrame: The modified transcript with the purchased column extracted
    """

    transcript_group.loc[~transcript_group.received, "purchased"] = transcript_group.non_offer_amount > 0.0
    transcript_group.loc[transcript_group.received, "purchased"] = transcript_group.viewed & transcript_group.completed

    return transcript_group