In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about how to install and use MNE-Python. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
The main contents are as follows:
Install Python (Anaconda is recommended)
Install MNE-python
Download case data in MNE-Python
Test whether the installation is successful and easy to use
1. Install Python (Anaconda is recommended) [here is the installation on the windows system]
Anaconda is used to manage different versions of the Python environment. Toolkits can be easily installed, updated and uninstalled, and the corresponding dependency packages can be installed automatically during installation. At the same time, Anaconda comes with many commonly used software packages and scientific calculation packages, such as Numpy and Pandas needed in data analysis, matplotlib for data visualization, and Jupyter notebook [Jupyter Notebook is a Web application that supports real-time code, mathematical equations, visualization and Markdown for uses including data cleaning and conversion, numerical simulation, statistical modeling, machine learning, etc.]. Therefore, it is recommended to install Anaconda, as it already includes Python and commonly used Python tool libraries.
First go to the official website to download: https://www.anaconda.com/distribution/
It is recommended to install the Python3.x version of Anaconda because the Python2.x version will not be maintained soon, as shown in the following figure.
You can also install previous versions of Anaconda from Python3.7
(that is, historical version: https://repo.anaconda.com/archive/)
Select Anaconda3 because Anaconda3 stands for Python3.x.
For specific installation tutorials, please see:
Https://blog.csdn.net/zyb228/article/details/103249706
After installation, you must remember to configure the environment
two。 Install MNE-python
In the console, enter:
Pip install-U mne
If there is no error in the installation process, the installation is successful. If there is a problem with the installation, you can take a screenshot and ask questions in the WeChat group or QQ group.
3. Download case data in MNE-Python
According to the reaction of friends in the exchange group, the download of official MNE-Python data is very slow.
Here is the official case of MNE-Python: MNE-sample-data download.
Download address:
Please follow the BCI community official account.
The backend replied "MNES" to get the official MNE-sample-data (1.3G) data. If it fails, you can contact it on the official account.
4. Test whether the installation is successful and easy to use
First click in the red box on the left, or enter the contents of the right picture below in the console.
The web application of Jupyter notebook will pop up in the browser as follows:
You can generate an editable page, edit the following code in the editing page, and click run, as shown below
If the following results appear, the installation is successful.
Note that the path where the downloaded data is stored needs to be assigned to fname. Take a look at the following code, I am stored in the data of F disk.
# introduce the python library import mnefrom mne.datasets import sampleimport matplotlib.pyplot as plt# the fif file storage address fname = 'FRU _ max _ data _ user _ MNEMY _ sampleMudata _ Meg _ If it does not exist, download the modified data "" raw = mne.io.read_raw_fif (fname) "" case: get good MEG data within 10-20 seconds # choose those good MEG signals (good MEG signals) according to type By setting exclude= "bads") channel, the result is that the index "" picks = mne.pick_types (raw.info, meg=True, exclude='bads') t_idx = raw.time_as_index ([10.,20.]) data, times = raw [picks, t_idx [0]: t_idx [1]] plt.plot (times,data.T) plt.title ("Sample channels") plt.show ()
"" draw SSP vector "raw.plot_projs_topomap () plt.show ()"
"draw electrode position"raw.plot_sensors () plt.show () above is how to install and use MNE-Python. If you happen to have similar doubts, please refer to the above analysis to understand." If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.