Skip to content

Instantly share code, notes, and snippets.

View HHammond's full-sized avatar

Henry Hammond HHammond

  • Ottawa, Ontario
View GitHub Profile
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import pyplot as plt\n",
"import seaborn as sns\n",
@HHammond
HHammond / Trie.h
Last active May 13, 2018 16:57
Objective C Trie Implementation
#import <Foundation/Foundation.h>
typedef void (^TrieBlock)(id obj, BOOL *stop);
@interface Trie : NSObject
@property (readonly) unichar value;
@property (getter = isLeaf) BOOL isLeaf;
@property (readonly, getter=isHead) BOOL head;
@HHammond
HHammond / Pandas Table Summary
Last active February 3, 2018 04:51
Pandas Pretty Table CSS
import numpy as np
import pandas as pd
from functools import partial
def summary(df, fn=np.sum, axis=0, name='Total',
table_class_prefix='dataframe-summary'):
"""Append a summary row or column to DataFrame.
Input:
------
@HHammond
HHammond / Theming IPython
Last active August 29, 2015 14:02
A quick tutorial on customizing the IPython notebook.
{
"metadata": {
"name": "",
"signature": "sha256:ae12cadbe088aa2df4c44761da5172223e468a824bc68e52b427b2314b428942"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@HHammond
HHammond / Bayesian t-test
Last active August 29, 2015 14:02
Bayesian t-Test
{
"metadata": {
"name": "",
"signature": "sha256:40d1e33fbcc5eeb5b32043afa79b7ee4af7041e599111a112a8864e2fbcfcd5c"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
/* Change code font */
.CodeMirror pre{
font-family: 'Source Code Pro', Consolas, monocco, monospace;
}
/* Change input prompt size */
div.input{
/*width: 105ex;*/
}