for dirname, dirnames, res_files in os.walk('./'+res_dir):
if len(dirnames) > 0:
continue
- metadata = pd.read_csv(os.path.join(dirname, 'metadata.csv'))
+ try:
+ metadata = pd.read_csv(os.path.join(dirname, 'metadata.csv'))
+ except Exception:
+ print('Omitting run {} because metadata.csv is missing'.format(dirname))
+ continue
list_.append(metadata)
df = pd.concat(list_)
for dirname, dirnames, res_files in os.walk('./'+res_dir):
if len(dirnames) > 0:
continue
- metadata = pd.read_csv(os.path.join(dirname, 'metadata.csv'))
+ try:
+ metadata = pd.read_csv(os.path.join(dirname, 'metadata.csv'))
+ except Exception:
+ print('Omitting run {} because metadata.csv is missing'.format(dirname))
+ continue
for res in res_files:
if res in 'metadata.csv':