Skip to content

Instantly share code, notes, and snippets.

@jfbercher
jfbercher / testbib.ipynb
Created August 7, 2018 20:52
test_bib.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jfbercher
jfbercher / nbmerge.py
Created January 18, 2017 07:57 — forked from fperez/nbmerge.py
Merge/concatenate multiple IPython notebooks into one.
#!/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
@jfbercher
jfbercher / collapsed_outputs.tpl
Created May 10, 2016 12:41
Template for nbconvert/html for collapsed outputs
{%- extends 'full.tpl' -%}
{# This template preserves collapsed outputs after conversion to html.
Put it in your templates directory, see template_path in jupyter_nbconvert_config.json
Usage: jupyter nbconvert --template collapsed_outputs FILE.ipynb #}
{%- block header -%}
{{ super() }}
<script>
@jfbercher
jfbercher / gist:2048774e6992de88dd71
Created November 1, 2015 20:25
Extracting a directory from a git repo, with history
#from http://alyssafrazee.com/popping-a-subdirectory.html
git clone [email protected]:jfbercher/IPython-notebook-extensions.git
mv IPython-notebook-extensions/ latex_envs
git filter-branch --prune-empty --subdirectory-filter testing/latex_envs master
cd JFB/latex_envs/
git remote rm origin
git remote add origin https://github.com/jfbercher/latex_envs.git
git push -u origin master
@jfbercher
jfbercher / Install_IRKernel.md
Last active August 29, 2015 14:21
Notes for the installation of the IRKernel on the IPython notebook, under debian Jessie

These notes are the commands I used to install the RKernel in IPython 3.1 (Jupyter), under debian Jessie. -- may 22, 2015

Install everyting into a virtual environment (optional)

virtualenv -p python3 --system-site-packages ipython31 #create a new env
source ipython31/bin/activate # activate the env (use bash)
pip3 install ipython --upgrade  # install ipython in the new env
@jfbercher
jfbercher / PosICA.py
Last active August 29, 2015 14:16
Implementation of a blind source separation algorithm for positive sources. ( Oja E, Plumbley M., Neural Comput. 2004 )
# -*- coding: utf-8 -*-
"""
may 2014
# Author: JF Bercher
# This work is licensed under CreativeCommons Attribution-ShareAlike license
# http://creativecommons.org/licenses/by-sa/4.0/
"""
"""
Neural Comput. 2004 Sep;16(9):1811-25.
@jfbercher
jfbercher / jfb_kstest.py
Last active August 29, 2015 14:16
Implementation of Kolmogorov-Smirnov test (with selectable level $\alpha$) , returns decision, p-values, verbose mode
# Last update: october 19, 2014
## Kolmogorov-Smirnov test
# Author: JF Bercher
# This work is licensed under CreativeCommons Attribution-ShareAlike license
# http://creativecommons.org/licenses/by-sa/4.0/
from pylab import *
import numpy as np
def ecdf(v_data):