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
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) |
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
$if($and($eq(%compilation%,1), $eq(%albumartist%,Various Artists)), | |
$set(albumartist, $if2(%compiler%, %djmixer%, %label%))) | |
$set(albumartistsort, $if2(%compiler%, %djmixer%, %label%)))) |
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
''' | |
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 |
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
#!/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 |
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
%% 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 |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Aug 26 12:12:37 2015 | |
@author: naught101 | |
""" | |
import numpy as np | |
import matplotlib.pyplot as pl |
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
# -*- 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 | |
""" |
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
""" | |
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 |
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
#!/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 |
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
*-blx.bib | |
*.acn | |
*.acr | |
*.alg | |
*.aux | |
*.bbl | |
*.bcf | |
*.blg | |
*.dvi | |
*.fdb_latexmk |