def add_target_species(df, target):

    """
    Adds a binary target variable for the given species.
    """

    # Create the target variable
    df['target'] = df['species'].apply(lambda s: 1 if s == target else 0)

    return df