Created
March 9, 2017 01:57
-
-
Save fangeugene/fb0c39747c0890706fc9fa92a3e99328 to your computer and use it in GitHub Desktop.
Count Touchpad Positions
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
from models.match import Match | |
matches = Match.query(Match.year==2017).fetch() | |
near_count = 0 | |
middle_count = 0 | |
far_count = 0 | |
for match in matches: | |
for color in ['red', 'blue']: | |
if not match.score_breakdown: | |
continue | |
if match.score_breakdown[color]['touchpadNear'] == 'ReadyForTakeoff': | |
near_count += 1 | |
if match.score_breakdown[color]['touchpadMiddle'] == 'ReadyForTakeoff': | |
middle_count += 1 | |
if match.score_breakdown[color]['touchpadFar'] == 'ReadyForTakeoff': | |
far_count += 1 | |
print near_count, middle_count, far_count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment