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)] | |
# 田中チーム |
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
# groupby をインポート | |
from itertools import groupby | |
# 辞書型で定義 | |
TEAM_PRIZE = { | |
'山田チーム': 2500000, | |
'田中チーム': 400000, | |
'鈴木チーム': 3200000 | |
} |
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
import boto3 | |
from time import sleep | |
# region 指定は適切に | |
client = boto3.client('athena', region_name='us-west-2') | |
# ざっくりとクエリを投げる | |
response = client.start_query_execution( | |
QueryString='select * from test_table', | |
QueryExecutionContext={ |