Handle empty Empatica csv files.

sociality-task
Primoz 2022-08-22 14:18:12 +00:00
parent 4cfe5a3a98
commit 0aa0e82673
1 changed files with 2 additions and 0 deletions

View File

@ -57,6 +57,8 @@ def extract_empatica_data(data, sensor):
df = pd.DataFrame.from_dict(ddict, orient='index', columns=[column]) df = pd.DataFrame.from_dict(ddict, orient='index', columns=[column])
df[column] = df[column].astype(float) df[column] = df[column].astype(float)
df.index.name = 'timestamp' df.index.name = 'timestamp'
if df.empty:
return df
elif sensor == 'EMPATICA_ACCELEROMETER': elif sensor == 'EMPATICA_ACCELEROMETER':
ddict = readFile(sensor_data_file, sensor) ddict = readFile(sensor_data_file, sensor)