<jupyter_start><jupyter_text>HCP MEG Power Spectra Download the data (you need an account to do this)<jupyter_code>!s3cmd get s3://hcp-openaccess/HCP_900/100307/MEG/Restin/powavg/100307_MEG_3-Restin_powavg.mat<jupyter_output>s3://hcp-openaccess/HCP_900/100307/MEG/Restin/powavg/100307_MEG_3-Restin_powavg.mat -> ./100307_MEG_3-Restin_powavg.mat  [1 of 1]
 1668603 of 1668603   100% in    1s   954.58 kB/s  done<jupyter_text>Importage<jupyter_code>%matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd


import nibabel as nib<jupyter_output><empty_output><jupyter_text>Load the data<jupyter_code>from scipy.io import loadmat
f = '100307_MEG_3-Restin_powavg.mat'
mat = loadmat(f,struct_as_record=False,squeeze_me=True)
mat['freq']
freqs = mat['freq']
df = pd.DataFrame(freqs.powspctrm,columns=freqs.freq,index=freqs.label).T
fig, ax = plt.subplots(figsize=(12,3))

df.plot(legend=False,ax=ax,c='k', alpha=0.1,logy=True,logx=True)
df.mean(axis=1).plot(ax=ax,c='r',logy=True,logx=True, linewidth=2.)
df.to_csv('100307_MEG_3-Restin_powavg_ps.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13387241689128482, 'fraction_numerical': 0.07906558849955077, 'mean_word_length': 7.2518518518518515, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '558527', 'license': 'MIT', 'n_tokens_mistral': 539, 'n_tokens_neox': 485, 'n_words': 70, 'path': 'scratch/hcp_meg_power_spectra.ipynb', 'repo_name': 'Lefebvrelab/SpectralNeuralModels', 'size': '1113'}