Skip to content

Commit d25ed50

Browse files
committed
Move imports
1 parent be7aa36 commit d25ed50

2 files changed

Lines changed: 14 additions & 34 deletions

File tree

7-eeg/erp_avg_reref.ipynb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,15 @@
108108
},
109109
{
110110
"cell_type": "code",
111-
"execution_count": 1,
111+
"execution_count": null,
112112
"id": "c3cedbb5-8be2-456d-91b7-9b3c13f05ca7",
113113
"metadata": {},
114114
"outputs": [],
115115
"source": [
116116
"import mne\n",
117117
"mne.set_log_level('error') # reduce extraneous MNE output\n",
118+
"import matplotlib.pyplot as plt\n",
119+
"import numpy as np\n",
118120
"\n",
119121
"# Participant ID code\n",
120122
"p_id = 'sub-001'\n",
@@ -282,7 +284,7 @@
282284
},
283285
{
284286
"cell_type": "code",
285-
"execution_count": 6,
287+
"execution_count": null,
286288
"id": "6f3b434f",
287289
"metadata": {},
288290
"outputs": [
@@ -298,8 +300,6 @@
298300
}
299301
],
300302
"source": [
301-
"import matplotlib.pyplot as plt\n",
302-
"\n",
303303
"# define the channels we want plots for\n",
304304
"channels = ['Fz', 'Cz', 'Pz', 'Oz']\n",
305305
"\n",
@@ -329,7 +329,7 @@
329329
},
330330
{
331331
"cell_type": "code",
332-
"execution_count": 7,
332+
"execution_count": null,
333333
"id": "47403f59",
334334
"metadata": {},
335335
"outputs": [
@@ -369,8 +369,6 @@
369369
}
370370
],
371371
"source": [
372-
"import numpy as np\n",
373-
"\n",
374372
"# Specify times to plot at, as [min],[max],[stepsize]\n",
375373
"times = np.arange(0, np.max(epochs.times), 0.1)\n",
376374
"\n",

7-eeg/erp_group_stats.ipynb

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"cell_type": "code",
31-
"execution_count": 1,
31+
"execution_count": null,
3232
"id": "95dccf85-2fb3-4791-b0c9-cf71aecd369e",
3333
"metadata": {},
3434
"outputs": [],
@@ -39,7 +39,10 @@
3939
"mne.set_log_level('error') # reduce extraneous MNE output\n",
4040
"import matplotlib.pyplot as plt\n",
4141
"import numpy as np\n",
42-
"import glob"
42+
"import glob\n",
43+
"from scipy import stats\n",
44+
"from mne.stats import spatio_temporal_cluster_1samp_test\n",
45+
"from mne.channels import find_ch_adjacency, make_1020_channel_selections"
4346
]
4447
},
4548
{
@@ -194,7 +197,7 @@
194197
},
195198
{
196199
"cell_type": "code",
197-
"execution_count": 6,
200+
"execution_count": null,
198201
"id": "ea8c6e1a-f94e-4509-ad57-814dbbc10e81",
199202
"metadata": {},
200203
"outputs": [
@@ -207,20 +210,10 @@
207210
}
208211
],
209212
"source": [
210-
"from scipy import stats \n",
211-
"\n",
212213
"t, pval = stats.ttest_1samp(y, 0)\n",
213214
"print('Difference t = ', str(round(t[0], 2)), 'p = ', str(round(pval[0], 4)))"
214215
]
215216
},
216-
{
217-
"cell_type": "code",
218-
"execution_count": null,
219-
"id": "b6b9e108",
220-
"metadata": {},
221-
"outputs": [],
222-
"source": []
223-
},
224217
{
225218
"cell_type": "markdown",
226219
"id": "3d30a92c",
@@ -286,17 +279,8 @@
286279
"source": [
287280
"#### Prepare the Data for Mass Univariate Analysis\n",
288281
"\n",
289-
"MNE provides a `spatio_temporal_cluster_1samp_test()` function which we import here. "
290-
]
291-
},
292-
{
293-
"cell_type": "code",
294-
"execution_count": 7,
295-
"id": "6fd14f1b-83a7-445c-a7eb-2c50891e3ecc",
296-
"metadata": {},
297-
"outputs": [],
298-
"source": [
299-
"from mne.stats import spatio_temporal_cluster_1samp_test"
282+
"MNE provides a `spatio_temporal_cluster_1samp_test()` function which we imported above using\n",
283+
"```from mne.stats import spatio_temporal_cluster_1samp_test```."
300284
]
301285
},
302286
{
@@ -454,7 +438,7 @@
454438
},
455439
{
456440
"cell_type": "code",
457-
"execution_count": 12,
441+
"execution_count": null,
458442
"id": "5e963988",
459443
"metadata": {},
460444
"outputs": [
@@ -480,8 +464,6 @@
480464
}
481465
],
482466
"source": [
483-
"from mne.channels import find_ch_adjacency, make_1020_channel_selections\n",
484-
"\n",
485467
"# Create ROIs by checking channel labels\n",
486468
"selections = make_1020_channel_selections(diff_waves[0].info, midline=\"12z\")\n",
487469
"time_unit = dict(time_unit=\"s\")\n",

0 commit comments

Comments
 (0)