Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
stroke: #fff;
stroke-width: 1.5px;
}
.link {
@rossant
rossant / index.md
Last active August 29, 2015 14:12
IPython notebook ==> Python function

Notebooks are great for interactive use, not so much for being reused in an automatic fashion. How to make a notebook reusable (for example in an analysis pipeline)?

Write your notebook 'mynotebook.ipynb' as usual. Then add a special comment in some cells:

### input
x = 0
y = 0
@rossant
rossant / markers.py
Created January 28, 2015 14:45
Point sprint example with VisPy
import sys
import numpy as np
from vispy import app, scene
canvas = scene.SceneCanvas(keys='interactive')
view = canvas.central_widget.add_view()
view.set_camera('turntable', mode='perspective', up='z', distance=2,
azimuth=30., elevation=30.)
pos = .25 * np.random.randn(1000, 3)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from __future__ import print_function
import os
import os.path as op
import shutil
from pprint import pprint
from timeit import default_timer
import h5py
@rossant
rossant / ipyparallel_test.py
Created September 29, 2015 19:06
Fixture for IPython.parallel and pytest
import os
from pytest import yield_fixture
@yield_fixture(scope='module')
def ipy_client():
def iptest_stdstreams_fileno():
return os.open(os.devnull, os.O_WRONLY)
@rossant
rossant / 05_kernel.ipynb
Last active October 29, 2015 22:48
plot_kernel
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rossant
rossant / ruzzle
Created February 21, 2013 00:32
Playing with Ruzzle in Python
{
"metadata": {
"name": "ruzzle"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@rossant
rossant / ascii_art
Last active December 15, 2015 01:19
ASCII art in the IPython notebook.
{
"metadata": {
"name": "ascimage"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{