Skip to content

Instantly share code, notes, and snippets.

View luiarthur's full-sized avatar

Arthur Lui luiarthur

View GitHub Profile
@luiarthur
luiarthur / covariance_to_correlation.py
Created January 21, 2022 20:50 — forked from wiso/covariance_to_correlation.py
Compute correlation matrix from covariance matrix using numpy
import numpy as np
def correlation_from_covariance(covariance):
v = np.sqrt(np.diag(covariance))
outer_v = np.outer(v, v)
correlation = covariance / outer_v
correlation[covariance == 0] = 0
return correlation
@luiarthur
luiarthur / tmux_local_install.sh
Created September 25, 2015 16:18 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8