def shift_data(x):
    """Shifts the data under the median.

    Function that takes in a list of data, and shifts all values
    below the median value of the data by the max difference,
    effectively shifting parts of the data periodically in order to
    give clusters for visualization.

    Parameters
    ----------
    x : list
        Floats, data values

    Returns
    -------
    xnorm : list
        Floats where some values are shifted values of x,
        and some are left unchanged.

    """
    xmin, xmax = min(x), max(x)
    xnorm = []
    dx = xmax - xmin
    medix = xmin + 0.5 * dx
    for i in x:
        if i < medix:
            xnorm.append(i + dx)
        else:
            xnorm.append(i)
    return xnorm
