This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from functools import partial | |
from time import perf_counter | |
from contextlib import contextmanager | |
import numpy as np | |
from scipy.integrate import trapezoid # quad | |
# from scipy.interpolate import interp1d | |
from scipy.stats import norm, gaussian_kde | |
import matplotlib.pyplot as plt | |
import mne |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from collections import namedtuple | |
import numpy as np | |
from scipy.stats import norm, zscore | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import seaborn as sns | |
import mne | |
n_jobs = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyrankvote import Ballot, Candidate, instant_runoff_voting | |
votes = dict(tri=(10, 8, 2, 3, 4), | |
kaj=(1, 9, 10), | |
dan=(2, 10, 4, 5), | |
gus=(5, 3, 7), | |
mer=(5, 1, 4), | |
ori=(6, 2, 10, 4), | |
jai=(4, 1, 10, 5), | |
ch_=(4, 7, 10, 9) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
@author: Daniel McCloy | |
Load SSVEP epochs and plot PSDs, phases, etc. | |
data at https://dan.mccloy.info/data/prek_1964-pre_camp-pskt-epo.fif | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env Rscript | |
library(dplyr, warn.conflicts=FALSE) | |
# load phoible data (to get feat. col. names) | |
"~/Documents/academics/research/phoible/dev/data" -> data_dir | |
load(file.path(data_dir, "phoible.RData")) | |
# get feature column names | |
phoible %>% | |
select(tone:click) %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "", | |
"css_prefix_text": "icon-", | |
"css_use_suffix": false, | |
"hinting": true, | |
"units_per_em": 1000, | |
"ascent": 850, | |
"glyphs": [ | |
{ | |
"uid": "ea4ad928c87154ed3eb2ec50daea01cc", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import mne | |
# load sample data | |
sample_data_folder = mne.datasets.sample.data_path() | |
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample', | |
'sample_audvis_raw.fif') | |
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False).crop(tmax=60) | |
events = mne.find_events(raw, stim_channel='STI 014') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import tracemalloc | |
tracemalloc.start() | |
import os | |
from mayavi import mlab | |
import mne | |
mlab.options.offscreen = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(phonR) # convexHullArea | |
library(sp) # SpatialPolygons, etc | |
library(rgeos) # gIntersection | |
data(indoVowels) | |
female_two <- indo[indo$subj == "F02",] | |
by_vowel <- split(female_two, female_two$vowel) | |
hull_indices <- sapply(by_vowel, function(df) with(df, chull(f1, f2))) | |
hulls <- sapply(names(by_vowel), function(v) by_vowel[[v]][hull_indices[[v]],], | |
simplify=FALSE) | |
matrices <- sapply(hulls, function(df) as.matrix(df[,c("f1", "f2")])) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder