-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
plz add
# TODO: move to biocutils.
@singledispatch
def table(x: Sequence, sort: bool = True) -> biocutils.IntegerList:
output = {}
for v in x:
if v in output:
output[v] += 1
else:
output[v] = 1
if sort:
collected = sorted(output.keys())
tmp = {}
for y in collected:
tmp[y] = output[y]
output = tmp
return biocutils.IntegerList.from_dict(output)see also #31 to make sure the output is actually an IntegerList.
Metadata
Metadata
Assignees
Labels
No labels