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 numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.collections import LineCollection | |
def line_collection(t, spikes): | |
ax = plt.subplot(111) | |
ts, ns = spikes.shape | |
segs = np.zeros((ns, ts, 2), np.float32) | |
segs[:, :, 1] = spikes.T |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
function run() { | |
setInterval( drawShape, 500 ); | |
} | |
function drawShape(){ | |
// get the canvas element using the DOM | |
var canvas = document.getElementById('mycanvas'); |
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
#get cluster labels | |
labels = clusters.labels | |
# get spike times | |
sp_times = events.sp_times['data'] | |
# get spikes of class 1 | |
sp_times_cl1 = sp_times[labels==1] | |
# get peak-to-peak amplitude | |
n_channels = 2 |
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 PCA(data,ncomps=2): | |
"""Perfrom a principle component analysis. | |
Parameters | |
---------- | |
data : array | |
(n_vars, n_obs) array where `n_vars` is the number of | |
variables (vector dimensions) and `n_obs` the number of | |
observations |
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 python | |
#coding=utf-8 | |
from matplotlib import cm | |
from matplotlib import colors | |
import numpy as np | |
import matplotlib.pyplot as plt | |
cm = colors.LinearSegmentedColormap.from_list( |
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": "io_perf_test" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 matplotlib as pyplot | |
from lxml import etree | |
#do some plotting | |
plt.savefig(fig_file) | |
width, height = '3.8in', '2.8in' | |
with file(fig_file, 'r') as fid: | |
tree = etree.parse(fid) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer