def choose_x(x, x_new):
    """Choice the x array with the smallest number of elements."""
    if x.shape[0] == 0:
        # for initial empty array
        return x_new
    else:
        return x if x.shape[0] < x_new.shape[0] else x_new