Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

add GroupBy #3

Open
h-dav opened this issue Apr 9, 2022 · 0 comments
Open

add GroupBy #3

h-dav opened this issue Apr 9, 2022 · 0 comments
Labels
good first issue Good for newcomers

Comments

@h-dav
Copy link
Owner

h-dav commented Apr 9, 2022

data = sorted(data, key=keyfunc)
for k, g in groupby(data, keyfunc):
    groups.append(list(g))      # Store group iterator as a list
    uniquekeys.append(k)
input ("AAABBCD")
result
k = "A"
g = "AAA"
@h-dav h-dav added the good first issue Good for newcomers label Apr 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant