def rankDict(data):
    """count array to rank dict
  """
    ks = sorted(data)
    total = 0
    rd = {}
    for k in ks:
        total += data[k]
        rd[k] = total - (data[k] - 1) / 2.0
    return rd
