#! /bin/env python
FUDGE = 1e-7

def binitems(data,rangeMin,rangeMax,rangeStep):
    values = data[:]
    values.sort()
    numValues = len(values)

    counterList = []
    uboundList = []

    ubound = rangeMin
    index = 0
    while ubound <= rangeMax + FUDGE:
        counter = 0

        while index < numValues and values[index] <= ubound + FUDGE:
            counter += 1
            index += 1

        counterList.append(counter)
        uboundList.append(ubound)
        ubound += rangeStep
    counterList[-1] += numValues - index
    return counterList,uboundList

zauc = [ float(z) for z in file('zauc.tab') ]

for count,bin in zip(*binitems(zauc,0.5,1.0,0.05)):
    print count,bin

