ValueError: Type names and field names must be valid identifiers: 'Subject ID'
skim2257 opened this issue · comments
`
ValueError Traceback (most recent call last)
in
----> 1 namedtuple("Output", df.columns.astype("str").tolist())
~.conda\envs\lirc-ldri\lib\collections_init_.py in namedtuple(typename, field_names, verbose, rename, module)
399 if not name.isidentifier():
400 raise ValueError('Type names and field names must be valid '
--> 401 'identifiers: %r' % name)
402 if _iskeyword(name):
403 raise ValueError('Type names and field names cannot be a '
ValueError: Type names and field names must be valid identifiers: 'Subject ID'
`
Could we use an alternative datatype to prevent error if the metadata sheet has column names with spaces (Subject ID
) or invalid characters (File Size (Bytes)
)? Or we could rename all columns, but this might be an issue when trying to debug.