Catch another possible exception.
parent
1d903f3629
commit
a36da99ccb
|
@ -136,8 +136,9 @@ def patch_ibi_with_bvp(ibi_data, bvp_data):
|
||||||
# Begin with the cr-features part
|
# Begin with the cr-features part
|
||||||
try:
|
try:
|
||||||
ibi_data, ibi_start_timestamp = empatica2d_to_array(ibi_data_file)
|
ibi_data, ibi_start_timestamp = empatica2d_to_array(ibi_data_file)
|
||||||
except IndexError as e:
|
except (IndexError, KeyError) as e:
|
||||||
# Checks whether IBI.csv is empty
|
# Checks whether IBI.csv is empty
|
||||||
|
# It may raise a KeyError if df is empty here: startTimeStamp = df.time[0]
|
||||||
df_test = pd.read_csv(ibi_data_file, names=['timings', 'inter_beat_interval'], header=None)
|
df_test = pd.read_csv(ibi_data_file, names=['timings', 'inter_beat_interval'], header=None)
|
||||||
if df_test.empty:
|
if df_test.empty:
|
||||||
df_test['timestamp'] = df_test['timings']
|
df_test['timestamp'] = df_test['timings']
|
||||||
|
|
Loading…
Reference in New Issue