From f9529c78538882879a07cb67e342eade8d2153ab Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Mon, 15 Sep 2014 17:01:13 +0200 Subject: isi distance and basic example --- pyspike/spikes.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pyspike/spikes.py (limited to 'pyspike/spikes.py') diff --git a/pyspike/spikes.py b/pyspike/spikes.py new file mode 100644 index 0000000..42b6501 --- /dev/null +++ b/pyspike/spikes.py @@ -0,0 +1,18 @@ +""" spikes.py + +Module containing several function to load and transform spike trains + +Copyright 2014, Mario Mulansky +""" + +import numpy as np + +def spike_train_from_string(s, sep=' '): + """ Converts a string of times into a SpikeTrain object. + Params: + - s: the string with (ordered) spike times + - sep: The separator between the time numbers. + Returns: + - array of spike times + """ + return np.fromstring(s, sep=sep) -- cgit v1.2.3