简体   繁体   中英

How can I convert a mne Info into a pandas dataframe?

I'm working with streamlit and EEG data. So I'm using mne library to process the edf files.

The thing is that to visualize into streamlit I would like to convert my data.info into a pandas dataframe.

type(data.info) ---> <class 'mne.io.meas_info.Info'>

Anyone knows how can I do this? Thanks!

You likely want to turn the signal data array into a dataframe, not the .info attribute, that holds information about channel position, sampling frequency or measurement date. The channel data are stored as a numpy array in ._data attribute of the Raw object, but the preferred way to access it is using .get_data() method.

However, if you just want to turn the channel data to a dataframe - Raw and Epochs objects have .to_dataframe() method .

Visualising the EEG signal is also easy with mne-python, you can do data.plot() for example. Before visualising the data you may also want to filter the signal, in such case you can use data.filter() method (specifying filter edges as arguments).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM