Skip to content

Instantly share code, notes, and snippets.

View draw_rates.py
#!/usr/bin/python
from __future__ import division
from collections import Counter
import pgn
import operator
import os
from matplotlib import pyplot as plt
from matplotlib import rcParams
rcParams.update({'figure.autolayout': True})
import numpy as np
View piece_densities.py
#!/usr/bin/python
import pgn
import numpy as np
from matplotlib import pyplot as plt
import sys
initial_piece_density = 0.5
decrease_per_capture = 0.015625
pgn_file = open(sys.argv[1], 'r')
View chess.py
import urllib.parse
import urllib.request
import re
import json
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
page = "List_of_chess_grandmasters"