Skip to content

Instantly share code, notes, and snippets.

View dschien's full-sized avatar

Daniel Schien dschien

  • University of Bristol
  • Bristol
View GitHub Profile
@dschien
dschien / scrape_gutenberg.ipynb
Created February 12, 2017 11:22
Simple test to parse a gutenberg doc with python and beautiful soup
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dschien
dschien / ipython notebook debugging.md
Created August 18, 2016 14:23
ipython notebook debugger example

add tracer anywhere

from IPython.core.debugger import Tracer
Tracer()()

set breakpoint

in tracer add module to sys path

@dschien
dschien / gist:66b8764c4ad1b7ed4f33
Created July 6, 2015 16:30
sklearn.linear_model.LinearRegression vs statsmodel OLS
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@dschien
dschien / plot_radar_results.py
Created February 4, 2014 15:04
From matplotlib radar example
__author__ = 'schien'
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.projections.polar import PolarAxes
from matplotlib.projections import register_projection
def radar_factory(num_vars, frame='circle'):
"""Create a radar chart with `num_vars` axes."""
@dschien
dschien / TestPOIWriteNamedCell.java
Last active December 19, 2015 18:49
Cumbersome but working Apache POI save named cell reference
import static org.junit.Assert.*;
import java.awt.Desktop;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Name;
import org.apache.poi.ss.usermodel.Row;
@dschien
dschien / TestPOIWriteNamedCell.java
Created July 15, 2013 17:42
Broken Apache POI save named reference The following code results in illegal named references that change when the selected cell changes in Excel 2013
import static org.junit.Assert.*;
import java.awt.Desktop;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Name;
import org.apache.poi.ss.usermodel.Row;