From bc8fd2d7e0acc82f09c6b8ef1498ad6bdac9dbe9 Mon Sep 17 00:00:00 2001 From: Kat Schelonka Date: Tue, 4 Feb 2020 16:21:48 -0800 Subject: [PATCH] Ensure start_frame is an int when using to index --- allensdk/brain_observatory/behavior/stimulus_processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allensdk/brain_observatory/behavior/stimulus_processing.py b/allensdk/brain_observatory/behavior/stimulus_processing.py index c69806495..0fcb3e091 100644 --- a/allensdk/brain_observatory/behavior/stimulus_processing.py +++ b/allensdk/brain_observatory/behavior/stimulus_processing.py @@ -32,7 +32,7 @@ def get_stimulus_presentations(data, stimulus_timestamps): # workaround to rename columns to harmonize with visual coding and rebase timestamps to sync time stimulus_table.insert(loc=0, column='flash_number', value=np.arange(0, len(stimulus_table))) stimulus_table = stimulus_table.rename(columns={'frame': 'start_frame', 'time': 'start_time', 'flash_number':'stimulus_presentations_id'}) - stimulus_table.start_time = [stimulus_timestamps[start_frame] for start_frame in stimulus_table.start_frame.values] + stimulus_table.start_time = [stimulus_timestamps[int(start_frame)] for start_frame in stimulus_table.start_frame.values] end_time = [] for end_frame in stimulus_table.end_frame.values: if not np.isnan(end_frame):