This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def downsample2d(inputArray, kernelSize): | |
"""This function downsamples a 2d numpy array by convolving with a flat | |
kernel and then sub-sampling the resulting array. | |
A kernel size of 2 means convolution with a 2x2 array [[1, 1], [1, 1]] and | |
a resulting downsampling of 2-fold. | |
:param: inputArray: 2d numpy array | |
:param: kernelSize: integer | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, os, glob, json | |
you = 'giessel' | |
data = 'tweets' | |
try: os.mkdir(data) | |
except Exception: pass | |
def run(max_id = False): | |
already = glob.glob("%s/*.json" % data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import HTML | |
import subprocess | |
import tempfile | |
from PIL import Image | |
def playNPArray(array, frameRate = 6): | |
# ffmpeg is fussy- images must be in the right format to encode right | |
uint8_array = np.uint8(array.astype('float').copy() / float(array.max()) * 2**8-1) | |
fileName = 'temp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "manual inline mode" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
## disconnect | |
# ./disconnect.rb -u yourusername [-o /your/path] [-p yourhttpproxyserver] | |
# | |
# This is a command-line utility for the bulk-downloading of run data from | |
# the connect.garmin.com web application, which has lackluster export | |
# capabilities. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "astro_ml_tutorial" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bayesian_blocks(t): | |
"""Bayesian Blocks Implementation | |
By Jake Vanderplas. License: BSD | |
Based on algorithm outlined in http://adsabs.harvard.edu/abs/2012arXiv1207.5578S | |
Parameters | |
---------- | |
t : ndarray, length N | |
data to be histogrammed |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.