pyxdf
pyxdf copied to clipboard
jooc: why are some values in stream meta-data lists of dicts and some just dicts?
I find this rather confusing. For example, if I want to look at channel labels for a stream I need something like:
for i, ch in enumerate(eeg_stream['info']['desc'][0]['channels'][0]['channel']):
print(ch['label'][0])
In what scenario would there ever be more than one label, desc, or (for that matter) list of channel dictionaries in info? It makes sense that 'channels' contains a list of 'channel' dicts, but that its value itself be a list of one list of 'channel' dicts.
Whenever I work with this I find myself constantly having to remind which values are lists and which are simply values. Especially confusing to me is the fact that nominal_srate is a list (again, there will only ever be one so why?) but effective_srate is not a list.
I am sure there is a perfectly good explanation for this but I can't work out what it could be.