From cb2c7532e6ac48073a3cbbccb809ae7631019b2b Mon Sep 17 00:00:00 2001 From: rasmusvt Date: Fri, 17 Jun 2022 15:46:33 +0200 Subject: [PATCH] Make sure data['path'] is in a list --- nafuma/xanes/io.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nafuma/xanes/io.py b/nafuma/xanes/io.py index 20aa717..816b8f5 100644 --- a/nafuma/xanes/io.py +++ b/nafuma/xanes/io.py @@ -110,6 +110,9 @@ def read_data(data: dict, options={}) -> pd.DataFrame: # Initialise DataFrame with only ZapEnergy-column xanes_data = pd.read_csv(data['path'][0])[['ZapEnergy']] + if not isinstance(data['path'], list): + data['path'] = [data['path']] + for filename in data['path']: columns.append(filename)