From d6462d271aeaf1be635cbc7c4317ae6a3b30b63f Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Fri, 12 Jun 2015 14:55:07 +0200 Subject: implement __getitem__ and __len__ for SpikeTrain This allows to use SpikeTrain objects to be used in many applications as if they were arrays with spike times. --- pyspike/spikes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pyspike/spikes.py') diff --git a/pyspike/spikes.py b/pyspike/spikes.py index 35d8533..b18d7eb 100644 --- a/pyspike/spikes.py +++ b/pyspike/spikes.py @@ -28,7 +28,8 @@ def spike_train_from_string(s, edges, sep=' ', is_sorted=False): # load_spike_trains_txt ############################################################ def load_spike_trains_from_txt(file_name, edges, - separator=' ', comment='#', is_sorted=False): + separator=' ', comment='#', is_sorted=False, + ignore_empty_lines=True): """ Loads a number of spike trains from a text file. Each line of the text file should contain one spike train as a sequence of spike times separated by `separator`. Empty lines as well as lines starting with `comment` are -- cgit v1.2.3