Skip to content

Instantly share code, notes, and snippets.

Avatar

David Hume djhume

View GitHub Profile
View ipynb_run_save.py
#!/usr/bin/env python
"""
Script for running and save notebooks from command line.
How to use: `ipynb_run_save.py foo.ipynb
Some tweaks over ipydoctest.py from minrk
by @damianavila
"""
@djhume
djhume / gist:6016388
Last active Dec 19, 2015
Example of EAtools use with the EA Data Warehouse
View gist:6016388
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@djhume
djhume / _.md
Created Jul 12, 2013
Tributary inlet
View _.md
@djhume
djhume / _.md
Created Jul 12, 2013
Tributary inlet
View _.md
@djhume
djhume / asx.py
Last active Dec 19, 2015
Read ASX pickle data into pandas
View asx.py
{
"metadata": {
"name": "asx"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@djhume
djhume / race_course
Created Jul 8, 2013
Example of how to calc the distance between lat/long pairs for yachting course, for Phil. Geopandas might be good for this...
View race_course
import math
def distance(origin, destination): #https://gist.github.com/rochacbruno/2883505
lat1, lon1 = origin
lat2, lon2 = destination
radius = 6371 # km
dlat = math.radians(lat2-lat1)
dlon = math.radians(lon2-lon1)
a = math.sin(dlat/2) * math.sin(dlat/2) + math.cos(math.radians(lat1)) \
You can’t perform that action at this time.