Skip to content

Instantly share code, notes, and snippets.

@witchfelicia
Created February 17, 2022 01:40
Show Gist options
  • Save witchfelicia/fbbfb9c416275b17628ce3275b011d8d to your computer and use it in GitHub Desktop.
Save witchfelicia/fbbfb9c416275b17628ce3275b011d8d to your computer and use it in GitHub Desktop.
helper function to print a groupby object for a Mage Academy lesson, Count Aggregate
def print_obj (gp):
groups = list(gp.groups.keys())
for i in range(len(groups)):
if i == len(groups)-1:
print(groups[i])
break
print(groups[i], end=", ")
if i % 4 == 0 and i != 0:
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment