def counter_to_list(counts):
    """ Takes a dict of form {elem: repeat_count} and constructs a list
        containing repeat_count occurrences of elem converted to float, for all items in the input """
    return [
        v
        for (elem, repeat_count) in counts.items()
        for v in [float(elem)] * repeat_count
    ]