def getXofMax(data):
    """
    locates the index of the maximum value found in a list or an array
    @param data the list or array that should be analyzed
    @return the index position (zero-based) of the maximum
    """
    valMax = data[0]
    xOfMax = 0
    for i in range(len(data)):
        if data[i] > valMax:
            valMax = data[i]
            xOfMax = i
    return xOfMax