# Solved! How to visualize features calculated from the MEG or EEG time series

**URL:** <https://mne.discourse.group/t/solved-how-to-visualize-features-calculated-from-the-meg-or-eeg-time-series/3409>\
**Category:** Support & Discussions\
**Tags:** visualization\
**Created:** [July 15, 2021, 3:14pm UTC](https://mne.discourse.group/t/solved-how-to-visualize-features-calculated-from-the-meg-or-eeg-time-series/3409 "2021-07-15T15:14:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![redhatw](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@redhatw](https://mne.discourse.group/u/redhatw)\
**Post date:** [July 15, 2021, 3:14pm UTC](https://mne.discourse.group/t/solved-how-to-visualize-features-calculated-from-the-meg-or-eeg-time-series/3409/1 "2021-07-15T15:14:12Z")

</div>

Below is the example code I used:

```python
import os
import numpy as np
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
                                    'sample_audvis_filt-0-40_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file)
ica = mne.preprocessing.ICA(n_components=20, random_state=97, max_iter=800)
ica.fit(raw)
ica.exclude = [1, 2] # details on how we picked these are omitted here
ica.plot_properties(raw, picks=ica.exclude)

entr = np.zeros([dat.shape[0],1])
N=10000 # take 10000 as a quick test
for i in range(dat.shape[0]):
    print(i)
    ts=dat[i,:N]
    #en = entropy(ts) # entropy is my code
    entr[i]=en
meginfo=mne.pick_info(raw.info, meg_channel_indices)
megidx=mne.pick_types(raw.info, meg='mag', eeg=False, exclude=[])
meginfo=mne.pick_info(raw.info, megidx)
mne.viz.plot_topomap(np.squeeze(entr[megidx]), meginfo, ch_type='meg', cmap='Spectral_r',extrapolate='head',sensors = True)

```

---

<div class="post-metadata">

**Author:** ![sappelhoff](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/sappelhoff/32/3276_2.png) [@sappelhoff](https://mne.discourse.group/u/sappelhoff)\
**Post date:** [October 18, 2021, 7:06pm UTC](https://mne.discourse.group/t/solved-how-to-visualize-features-calculated-from-the-meg-or-eeg-time-series/3409/2 "2021-10-18T19:06:24Z")

</div>

Hi @redhatw, sorry for the late reply. Is this solution the answer to some other question you saw on the forum? In that case, it’d be better if you could post your solution as an answer directly in the thread of that question.

Thanks! 🙂
