Skip to content

Instantly share code, notes, and snippets.

#!/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 December 19, 2015 20:58
Example of EAtools use with the EA Data Warehouse
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@djhume
djhume / _.md
Created July 12, 2013 00:41
Tributary inlet
@djhume
djhume / _.md
Created July 12, 2013 00:37
Tributary inlet
@djhume
djhume / asx.py
Last active December 19, 2015 12:29
Read ASX pickle data into pandas
{
"metadata": {
"name": "asx"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@djhume
djhume / race_course
Created July 8, 2013 04:25
Example of how to calc the distance between lat/long pairs for yachting course, for Phil. Geopandas might be good for this...
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)) \