import math


def nPVI(items):
    """Calculate the Normalized Pairwise Variability Index.

    :param items: (list) list of data values
    :returns: (float)

    """
    if len(items) < 2:
        return 0.
    n = len(items) - 1
    sumd = 0.
    for i in range(n):
        d1 = items[i]
        d2 = items[i+1]
        delta = math.fabs(d1 - d2)
        meand = (d1 + d2) / 2.
        sumd += delta / meand

    return 100. * sumd / n