import random


def create_individual_crossover(parents):
    """
    Will create a new individual by averaging the values of two
    random parents from parents.
    :param parents: the parents to use to create new individuals
    :return: a new individual made from two distinct parents
    """
    male_index = random.randint(0, len(parents) - 1)
    female_index = random.randint(0, len(parents) - 1)
    while female_index == male_index:
        female_index = random.randint(0, len(parents) - 1)
    male = parents[male_index]["individual"]
    female = parents[female_index]["individual"]
    individual = {}
    for key in male.keys():
        individual[key] = (male[key] + female[key]) / 2
    return individual