Skip to content

Instantly share code, notes, and snippets.

View phobson's full-sized avatar

Paul Hobson phobson

View GitHub Profile
@phobson
phobson / FocusDemo.ipynb
Last active October 17, 2018 18:45
Focus Demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phobson
phobson / pdconcat.py
Created November 25, 2014 22:01
funky pandas concat
import numpy
import pandas
numpy.random.seed(0)
index1 = pandas.MultiIndex.from_product(
[['A'], ['b'], ['one', 'two']],
names=['City', 'Street', 'House']
)
index2 = pandas.MultiIndex.from_product(
@phobson
phobson / conda_req.txt
Last active June 5, 2018 00:13
The split-apply-combine strategy applied to linear regression
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: win-64
cycler=0.10.0=py35_0
decorator=4.0.9=py35_0
ipykernel=4.3.1=py35_0
ipython=4.1.2=py35_0
ipython_genutils=0.1.0=py35_0
ipywidgets=4.1.1=py35_0
jinja2=2.8=py35_0
  • 00_references
  • 01_raw-data
  • 02_prepared-data
    • 20160925
    • 20171101
    • latest
  • 03_results
    • 20160926
    • 20171101
  • 20171102
@phobson
phobson / extra_facets.ipynb
Created August 9, 2017 15:03
Extra facets
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phobson
phobson / seaborngrids.ipynb
Created January 3, 2014 03:02
Custom grids in seaborn
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phobson
phobson / gs_example.ipynb
Created April 20, 2017 00:42
gs_example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phobson
phobson / task_template.py
Created April 6, 2017 15:20
My VS Code tasks template for python projects/conda
template = """\
{
"version": "0.1.0",
"isShellCommand": false,
"args": [],
"showOutput": "always",
"echoCommand": false,
"suppressTaskName": false,
"tasks": [
{
@phobson
phobson / dec.py
Created March 31, 2017 19:07
Python decorators
import numpy
def _dedenter(func):
""" dedents any string returned by a function. """
@wraps(func)
def wrapper(*args, **kwargs):
string = func(*args, **kwargs)
return dedent(string)
return wrapper
@phobson
phobson / mpl-reorg.md
Last active March 21, 2017 15:37
[Scratch] MPL Reorganization ideas

mpl-stat

  • boxplot
  • bxp (+ cboox.boxplot_stats)
  • violinplot
  • violin (+ cboox.violin_stats)
  • hist
  • hist2d
  • hexbin