Created
December 1, 2017 13:15
-
-
Save kaoru-furuta/b69744a0a92654b0553b774850b56a82 to your computer and use it in GitHub Desktop.
This file contains 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
for key, group in groupby(MEMBER_POINT, key=lambda x: x[0]): | |
print(key) | |
print(group) | |
print(list(group)) | |
# 山田チーム | |
# <itertools._grouper object at 0x10d4790b8> | |
# [('山田チーム', '山田', 10), ('山田チーム', '吉田', 20), ('山田チーム', '武田', 30)] | |
# 田中チーム | |
# <itertools._grouper object at 0x10d479160> | |
# [('田中チーム', '田中', 5), ('田中チーム', '田辺', 2)] | |
# 鈴木チーム | |
# <itertools._grouper object at 0x10d4790b8> | |
# [('鈴木チーム', '鈴木', 80)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment