Skip to content

Instantly share code, notes, and snippets.

Avatar

Jake Vanderplas jakevdp

View GitHub Profile
@jakevdp
jakevdp / random_seeds.csv
Created Apr 8, 2020
Counts of "seed(x)" in github (source http://grep.app)
View random_seeds.csv
seed count
0 8094
1 6700
2 1232
3 575
4 474
5 450
6 128
7 464
8 132
@jakevdp
jakevdp / kmeans.ipynb
Created May 11, 2018
Performance Python: 7 Strategies for Optimizing Your Numerical Code (PyCon 2018)
View kmeans.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakevdp
jakevdp / PEP8LineLengths.ipynb
Created Nov 10, 2017
Further exploration of line lengths and PEP8
View PEP8LineLengths.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakevdp
jakevdp / README.md
Last active Feb 20, 2020
A generator of random Bible-ish verses
View README.md

Bibleish.py

This is a simple NLTK Python script which uses N-grams to construct phrases from a generative language model trained on the King James Bible.

@jakevdp
jakevdp / Altair-Code-Gen.ipynb
Created Aug 10, 2016
Simple example of code generation with Altair
View Altair-Code-Gen.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakevdp
jakevdp / PythonCpp.ipynb
Last active Jan 8, 2020
Hack to make Python look like C++
View PythonCpp.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakevdp
jakevdp / Makefile
Last active Dec 26, 2019
Test of specializing sphinx autodoc
View Makefile
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
@jakevdp
jakevdp / TestHTMLRenderer.ipynb
Created Nov 18, 2019
Testing Altair's HTML renderer with nbviewer
View TestHTMLRenderer.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakevdp
jakevdp / README.rst
Created Dec 29, 2011
GMM BIC/AIC test
View README.rst

This includes a test of the new GMM routines in https://github.com/bthirion/scikit-learn/tree/gmm-fixes

By changing the line

GMM = mixture.GMM

at the top of the file, we can plot the BIC and AIC for each variant of GMM. Standard GMM works beautifully: it settles in on 3 components, which are a good description of the data. DPGMM and VBGMM produce some unexpected results.

@jakevdp
jakevdp / convolution_matrix.py
Last active Mar 12, 2019
Convolution Matrix
View convolution_matrix.py
# Author: Jake VanderPlas
# LICENSE: MIT
from __future__ import division
import numpy as np
def convolution_matrix(x, N=None, mode='full'):
"""Compute the Convolution Matrix