Skip to content

Instantly share code, notes, and snippets.

Avatar

Fernando Perez fperez

View GitHub Profile
@fperez
fperez / nbmerge.py
Created Jun 23, 2015
Merge/concatenate multiple IPython notebooks into one.
View nbmerge.py
#!/usr/bin/env python
# Note, updated version of
# https://github.com/ipython/ipython-in-depth/blob/master/tools/nbmerge.py
"""
usage:
python nbmerge.py A.ipynb B.ipynb C.ipynb > merged.ipynb
"""
import io
@fperez
fperez / README.md
Last active May 28, 2021
Polyglot Data Science with IPython
View README.md

Polyglot Data Science with IPython & friends

Author: Fernando Pérez.

A demonstration of how to use Python, Julia, Fortran and R cooperatively to analyze data, in the same process.

This is supported by the IPython kernel and a few extensions that take advantage of IPython's magic system to provide low-level integration between Python and other languages.

See the companion notebook for data preparation and setup.

@fperez
fperez / ProgrammaticNotebook.ipynb
Last active May 27, 2021
Creating an IPython Notebook programatically
View ProgrammaticNotebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / .bash_utils
Created May 17, 2012
Bash configuration utilities for easy layered PYTHONPATH management
View .bash_utils
# -*- sh -*-
# Utilities for bash config files
# Contact: Fernando Perez <fernando.perez@colorado.edu>
#-----------------------------------------------------------------------------
# Useful constants
# For os, user or processor dependent config
View .bash_utils
# -*- sh -*-
# Utilities for bash config files
# Contact: Fernando Perez <fperez@fperez.org>
#-----------------------------------------------------------------------------
# Useful constants
# For os, user or processor dependent config
@fperez
fperez / ipython-0.0.1.py
Created Jan 8, 2012
IPython 0.0.1, a simple script to be loaded as $PYTHONSTARTUP: of historical interest only...
View ipython-0.0.1.py
#!/usr/bin/env python
"""
Interactive execution with automatic history, tries to mimic Mathematica's
prompt system. This environment's main features are:
- Numbered prompts (In/Out) similar to Mathematica. Only actions that produce
output (NOT assingments, for example) affect the counter and cache.
- The following GLOBAL variables always exist (so don't overwrite them!):
_p: stores previous result which generated printable output.
@fperez
fperez / contour_overlap.py
Created Mar 9, 2011
Matplotlib contours with overlap control
View contour_overlap.py
"""Contours with overlap control.
This script generates widely spaced black contours, with a gray patch in a
subregion where more finely-spaced colored contours are visible. The gray
patch covers the black contours.
"""
import numpy as np
import matplotlib.mlab as mlab
from matplotlib.patches import Rectangle
@fperez
fperez / TwitterGraphs.ipynb
Last active May 6, 2020
Exploring graph properties of the Twitter stream with twython, networkx and IPython
View TwitterGraphs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / lp2gh-issues.py
Created Feb 20, 2011
Conversion from Launchpad bugs to GitHub ones
View lp2gh-issues.py
#!/usr/bin/env python
"""Launchpad to github bug migration script.
There's a ton of code from Hydrazine copied here:
https://launchpad.net/hydrazine
WARNING: this code was written for the Github issues v2 API, and has *not* been ported to v3. If anyone finds it useful and ports it, please drop me a pull request.
Usage
-----
@fperez
fperez / SimpleNeuralNets.ipynb
Last active May 28, 2019
Notes for "Why does deep and cheap learning work so well?" (ArXiv:1608.08225v1/cond-mat.dis-nn) by Lin and Tegmark.
View SimpleNeuralNets.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.