diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2014-09-15 17:01:13 +0200 |
---|---|---|
committer | Mario Mulansky <mario.mulansky@gmx.net> | 2014-09-15 17:01:13 +0200 |
commit | f9529c78538882879a07cb67e342eade8d2153ab (patch) | |
tree | 33f54461ff5c37c57d6006117ff3a02f21624053 /pyspike/spikes.py | |
parent | e08c05f9bf121e272aadce4fc79e9499e662111e (diff) |
isi distance and basic example
Diffstat (limited to 'pyspike/spikes.py')
-rw-r--r-- | pyspike/spikes.py | 18 |
1 files changed, 18 insertions, 0 deletions
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 <mario.mulansky@gmx.net> +""" + +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) |