Extracting event type from evoked object

MNE version: 1.5.1
Ubuntu 23.04

I have data with nested events where epochs around heartbeats are grouped within experiment events (ie, probes). I want to first average across heartbeat events within probe events, and then average across probe events based on some other data we’ve collected.

My approach is to average across heartbeat events using epochs.average(by_event_type=True), which gives me a list of Evoked objects, where each object corresponds to a different probe. I want to extract from each element in this list the probe event name that it corresponds to (eg, “Probe1”), so I can match it up with other data we’ve collected. I see this information listed in the sort of ‘header’ of the object , eg:

>>> evokeds = epochs.average(by_event_type=True)
>>> evokeds[0]
Out: <Evoked | 'Probe1' (average, N=6), -0.1 – 0.5 s, baseline off, 31 ch, ~90 kB>

But I don’t see any attributes in the Evoked object that would allow me to access that ‘Probe1’ string directly. Is there a less clumsy solution than converting to a string and using RegEx?

Thanks!

Hi, the string should be stored in evokeds[0].comment.

Best wishes,
Richard

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.