Skip to content

Instantly share code, notes, and snippets.

@mwaskom
mwaskom / wide_to_long_transform.ipynb
Last active May 11, 2020 19:06
Notebook for figuring out consistent transformations from a variety of "wide" data to a long-form plot dataframe
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / covid_small_multiples.ipynb
Created April 2, 2020 16:28
Small-multiples approach to comparing cumulative case trajectories across states
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / pysurfer_setup.md
Last active September 6, 2019 19:26
PySurfer on a headless linux server

Get pysurfer running on a headless server

There have been some issues lately getting PySurfer set up and running. Here is how I recently got things set up on our server.

1. Install PySurfer

I am pretty sure that the anaconda build of mayavi is broken, but I have had success installing everything with pip (go figure). To demonstrate, I am going to install everything into a fresh conda enviornment.

conda create -n setup_pysurfer python=3.7 pip
@mwaskom
mwaskom / lmplot_lapse.ipynb
Last active March 13, 2019 15:52
Use a custom psychometric function (e.g. nonzero lapse) with seaborn lmplot
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / cshl.py
Created July 22, 2018 13:28
Library for CSHL course project
import numpy as np
from numpy.fft import fft, ifft, fftshift
from scipy.stats import norm, multivariate_normal
from scipy.signal import convolve2d
from scipy.ndimage import gaussian_filter
from scipy.interpolate import NearestNDInterpolator
import matplotlib.pyplot as plt
import nibabel as nib
from surfer import Brain
from mayavi import mlab
@mwaskom
mwaskom / palettes.png
Last active April 24, 2024 15:47
Show all seaborn palettes and simulate what they look like with various color vision deficiencies. (The 10-element seaborn palettes will be part of the forthcoming 0.9 release).
palettes.png
@mwaskom
mwaskom / basic_tutorial.ipynb
Last active December 11, 2019 14:42
Copy of the new seaborn basic plots tutorial showing new functionality for forthcoming v0.9
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / dots_dataset.ipynb
Created October 22, 2017 21:46
Convert Roitman Shadlen LIP dataset from messy .mat to tidy .csv
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / wireframe_surface.ipynb
Created October 20, 2017 19:24
Use mayavi actor attributes to show the wireframe representation of the surface mesh
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / imports.py
Last active July 25, 2019 14:56
IPython magic to automate injecting import statements into a terminal/notebook. Put in ~/.ipython/profile_default/startup and call %imports <os> <fmri>
from IPython.core.magic import Magics, magics_class, line_magic
@magics_class
class Imports(Magics):
@line_magic
def imports(self, opts):
lines = []