View separate_points.py
def lat_lon_hex_mesh(bounds, d=3): | |
"""Creates a hexagonal lat/lon mesh within bounds that has a radial separation of d""" | |
lone, lonw, lats, latn = bounds | |
# heigt of equilatral triangle from radial distance sqrt(r^2 - (r/2)^2) | |
h = np.sqrt(0.75) * d | |
w = d / 2 | |
lat_vals = np.arange(lats, latn, h) |
View gist:0f73ca85a9ab6d4be3980cde8da9c0cc
$if($and($eq(%compilation%,1), $eq(%albumartist%,Various Artists)), | |
$set(albumartist, $if2(%compiler%, %djmixer%, %label%))) | |
$set(albumartistsort, $if2(%compiler%, %djmixer%, %label%)))) |
View mutual_info.py
''' | |
Non-parametric computation of entropy and mutual-information | |
Adapted by G Varoquaux for code created by R Brette, itself | |
from several papers (see in the code). | |
These computations rely on nearest-neighbor statistics | |
''' | |
import numpy as np |
View modelbycluster.py
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Scikit-Learn Model-by-Cluster wrapper. | |
Original code by jnorthman: https://gist.github.com/jnothman/566ebde618ec18f2bea6 | |
""" | |
import numpy as np |
View ametsoc.latex
%% AMS pandoc template. | |
%% https://gist.github.com/naught101/f369e9796c36965b0cf6 | |
%% Converts pandoc to a latex file along the lines of the templates from | |
%% https://www2.ametsoc.org/ams/index.cfm/publications/authors/journal-and-bams-authors/author-resources/latex-author-info/preparing-a-latex-manuscript-for-submission/ | |
%% The results of this template should work with ametsoc.cls and ametsoc2014.bst | |
%% out of the box. | |
%% amssamp1.tex is nearly identical to amssamp2.tex, except | |
%% that amssamp2.tex uses the [twocol] option to produce |
View toy_rank_histograms.py
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Aug 26 12:12:37 2015 | |
@author: naught101 | |
""" | |
import numpy as np | |
import matplotlib.pyplot as pl |
View pop_projections.py
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Aug 17 10:53:51 2015 | |
Population projections with low-discrepancy sequence based colour scheme. | |
http://www.storytellingwithdata.com/blog/2015/8/3/visualization-challenge-world-population-forecast | |
@author: naught101 | |
""" |
View python_rank_benchmarking.py
""" | |
Benchmarking the methods at | |
http://stackoverflow.com/questions/5284646/rank-items-in-an-array-using-python-numpy | |
""" | |
import timeit | |
from scipy.stats import rankdata | |
import pandas as pd | |
import numpy as np |
View extractannotations.py
#!/usr/bin/env python3 | |
import poppler | |
import sys | |
import urllib.request, urllib.parse, urllib.error | |
import os | |
def main(): | |
input_filename = sys.argv[1] | |
# http://blog.hartwork.org/?p=612 |
View .gitignore
*-blx.bib | |
*.acn | |
*.acr | |
*.alg | |
*.aux | |
*.bbl | |
*.bcf | |
*.blg | |
*.dvi | |
*.fdb_latexmk |