def create_encoded_array(index, size, numeric_type=int):
    """
    Creates a one-hot encoded array with a one at the given index
    and zeroes everywhere else, up to the given size.

    :param index:           The index to set to one.
    :param size:            The size of the encoded array.
    :param numeric_type:    The numeric type for the values in the array.
    :return:        The one-hot encoding for the given parameters.
    """
    encoded_value = [numeric_type(0)] * size
    encoded_value[index] = numeric_type(1)
    return encoded_value
