rogerfitz / tutorials Goto Github PK
View Code? Open in Web Editor NEWGit Repo for Articles on Ergo Sum blog and the youtube channel https://www.youtube.com/channel/UCiie9CN--dazA7iT2sry5FA
Home Page: https://www.ergosum.co
License: MIT License
Git Repo for Articles on Ergo Sum blog and the youtube channel https://www.youtube.com/channel/UCiie9CN--dazA7iT2sry5FA
Home Page: https://www.ergosum.co
License: MIT License
When running this block I receive an error
games_played={}
weekly_matchups=[]
for week, game_type in enumerate(game_types_per_week):
#print(week)
print(week,game_type)
matchups=None
#Potentially invalid matchups can happen depending on the contstraints so each week will have a given number of attempts.
#It's also possible a prior week leads to an impossible state. We will only support rerunning on the week level
ATTEMPTS=100
for attempt in range(ATTEMPTS):
try:
matchups=gen_matchups(all_teams,universes[game_type])
break
except:
continue
if not matchups:
raise
else:
for name, universe in universes.items():
for team_1,team_2 in matchups:
for a,b in permutations([team_1,team_2], 2):
if b in universe.get(a,[]):
universes[name][a].remove(b)
weekly_matchups.append(matchups)
[x[0] for x in weekly_matchups]
RuntimeError Traceback (most recent call last)
/var/folders/h0/ffqb5f990rqfgzshykzbr2gm0000gn/T/ipykernel_88125/299313015.py in
21 continue
22 if not matchups:
---> 23 raise
24 else:
25 for name, universe in universes.items():
RuntimeError: No active exception to reraise
The only change I have made is to use 4 divisions instead of 3:
```from collections import defaultdict
divisions = defaultdict(list)
for i,team in enumerate(all_teams):
divisions[i//3].append(team)#every 4th team from the random list is assigned to the same division
divisions```
Should
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.