# Average evoked data in a certain time range

**URL:** <https://mne.discourse.group/t/average-evoked-data-in-a-certain-time-range/1837>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [May 6, 2019, 1:17pm UTC](https://mne.discourse.group/t/average-evoked-data-in-a-certain-time-range/1837 "2019-05-06T13:17:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 6, 2019, 1:17pm UTC](https://mne.discourse.group/t/average-evoked-data-in-a-certain-time-range/1837/1 "2019-05-06T13:17:46Z")

</div>

External Email - Use Caution

Dear MNE developers,

I would like to ask if it is possible to average the evoked data in a certain time range? For example I would like to have a 2 seconds average (when t=1 to t=3) out of 4 seconds recording (t=0 to t=4) -\> middle span averaging.  
My objective is to plot a topomap using evoked.plot\_topomap in the 1-3 seconds middle span average (the output is just a single topomap image as the result of averaging from the 1-3 seconds)

Best regards,  
Melvin H.  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20190506/01aad4c0/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190506/01aad4c0/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 7, 2019, 12:37am UTC](https://mne.discourse.group/t/average-evoked-data-in-a-certain-time-range/1837/2 "2019-05-07T00:37:48Z")

</div>

External Email - Use Caution

Hi Melvin,

I believe you can do this interactively in evoked.plot  
\<[https://martinos.org/mne/dev/generated/mne.Evoked.html#mne.Evoked.plot](https://martinos.org/mne/dev/generated/mne.Evoked.html#mne.Evoked.plot)\>.  
If you want to script this, the easiest solution might be to do the  
averaging yourself by following these steps:

1. Crop the data to the desired time interval using evoked.crop  
2. Average the resulting evoked.data using numpy  
3. Use EvokedArray to create a new evoked instance from this average numpy  
array  
4. Use evoked.plot\_topomap on this average.

Hope that helps,  
Mainak
