Skip to content

Instantly share code, notes, and snippets.

View phobson's full-sized avatar
⛏️

Paul Hobson phobson

⛏️
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phobson
phobson / padded.py
Created February 13, 2015 21:44
python function to stack/offset numpy arrays with incompatible dimentions
def padded_stack(a, b, how='vert', where='+', shift=0,
a_transform=None, b_transform=None):
'''Merge 2-dimensional numpy arrays with different shapes
Parameters
----------
a, b : numpy arrays
The arrays to be merged
how : optional string (default = 'vert')
The method through wich the arrays should be stacked. `'Vert'`
@phobson
phobson / MVreg.ipynb
Created February 9, 2015 19:13
Simple multivariate regressionwith python and statsmodels
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "",
"signature": "sha256:374fe606e58df33dda5096327ddcbcb3ac02abd904757d23de4272c736d8f837"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@phobson
phobson / Lognormref.ipynb
Last active September 17, 2020 16:35
Lognormal python ref
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phobson
phobson / gist:ca6bc1aa442dceff2502
Last active August 29, 2015 14:12
Setting up pygridgen and/or Octant

Setting up a fresh linux box for grid generation

Basics linux stuff

$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get autoremove libreoffice-common
$ sudo apt-get install git vim build-essential gfortran

Getting miniconda and creating an environment

@phobson
phobson / boxplots.ipynb
Created December 23, 2014 07:12
Fancy Boxplot demos
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phobson
phobson / ppdemo.ipynb
Created November 30, 2014 01:45
probplot demp
Loading
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(