Created
February 17, 2022 01:40
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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