Giter Club home page Giter Club logo

rogerfitz / tutorials Goto Github PK

View Code? Open in Web Editor NEW
79.0 6.0 47.0 302.46 MB

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

Jupyter Notebook 98.32% Python 0.08% HTML 0.97% CSS 0.08% JavaScript 0.55% Shell 0.01%
tech sports visualizations draft-kings fan-duel algorithmia google-maps-api fivethirtyeight python data-science

tutorials's Introduction

tutorials

Setup

NEW CHANGES

Going forward all new tutorial projects will follow the pattern of subreddit_analysis/ with a readme and specific install steps.

For older projects feel free to create an issue if you need help installing and I will fix it sooner. In general I would recommend using Miniconda Latest 64 bit for your operating system.

Install Steps

Windows:

  1. Download Minconda -- Select Latest Windows 64 bit
  2. Install and select the option to add Minconda to your system path (it isn't default)
  3. Install Windows Terminal
  4. [Optional but recommended] Install git-bash
  5. Open windows terminal and select a shell of your choice, on Windows I use Command Prompt or Git Bash
  6. Test that conda was installed conda info should give something like
active environment : None
       user config file : C:\Users\minim\.condarc
 populated config files :
          conda version : 4.10.1
    conda-build version : not installed
         python version : 3.9.1.final.0
       virtual packages : __cuda=11.3=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : C:\Users\minim\miniconda3  (writable)
      conda av data dir : C:\Users\minim\miniconda3\etc\conda
  conda av metadata url : https://repo.anaconda.com/pkgs/main
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\minim\miniconda3\pkgs
                          C:\Users\minim\.conda\pkgs
                          C:\Users\minim\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\minim\miniconda3\envs
                          C:\Users\minim\.conda\envs
                          C:\Users\minim\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.10.1 requests/2.25.0 CPython/3.9.1 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False
  1. Now choose where you want to run the projects. Use cd commands and you can download the repository by doing git clone https://github.com/rogerfitz/tutorials
  2. Nearly done now, cd into the directory and test that a tutorial works. I'd recommend starting with subreddit_analysis/README.md

Mac

  1. Download Minconda -- Select Latest Mac 64 bit
  2. Install and select the option to add Minconda to your system path (it isn't default)
  3. Open the Mac Terminal and test that conda was installed conda info should give something like
active environment : None
       user config file : C:\Users\minim\.condarc
 populated config files :
          conda version : 4.10.1
    conda-build version : not installed
         python version : 3.9.1.final.0
       virtual packages : __cuda=11.3=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : C:\Users\minim\miniconda3  (writable)
      conda av data dir : C:\Users\minim\miniconda3\etc\conda
  conda av metadata url : https://repo.anaconda.com/pkgs/main
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\minim\miniconda3\pkgs
                          C:\Users\minim\.conda\pkgs
                          C:\Users\minim\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\minim\miniconda3\envs
                          C:\Users\minim\.conda\envs
                          C:\Users\minim\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.10.1 requests/2.25.0 CPython/3.9.1 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False
  1. Install github command line if you don't have it already, in Mac terminal brew install git
  2. Now choose where you want to run the projects. Use cd commands and you can download the repository by doing git clone https://github.com/rogerfitz/tutorials
  3. Nearly done now, cd into the directory and test that a tutorial works. New to python? I'd recommend starting with intro_to_jupyter otherwise go with subreddit_analysis

tutorials's People

Contributors

dependabot[bot] avatar rogerfitz avatar usernameguyperson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tutorials's Issues

No active exception to reraise

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]

Error message

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```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.