Make sure filenames is a list before reading
This commit is contained in:
parent
c0af1dc84c
commit
254becff69
1 changed files with 3 additions and 2 deletions
|
|
@ -183,12 +183,13 @@ def read_data(data: dict, options={}) -> pd.DataFrame:
|
||||||
|
|
||||||
columns = ['ZapEnergy']
|
columns = ['ZapEnergy']
|
||||||
|
|
||||||
|
if not isinstance(data['path'], list):
|
||||||
|
data['path'] = [data['path']]
|
||||||
|
|
||||||
# Initialise DataFrame with only ZapEnergy-column
|
# Initialise DataFrame with only ZapEnergy-column
|
||||||
xanes_data = pd.read_csv(data['path'][0])[['ZapEnergy']]
|
xanes_data = pd.read_csv(data['path'][0])[['ZapEnergy']]
|
||||||
xanes_data['ZapEnergy'] += options['adjust']
|
xanes_data['ZapEnergy'] += options['adjust']
|
||||||
|
|
||||||
if not isinstance(data['path'], list):
|
|
||||||
data['path'] = [data['path']]
|
|
||||||
|
|
||||||
for filename in data['path']:
|
for filename in data['path']:
|
||||||
columns.append(filename)
|
columns.append(filename)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue