Skip to content

Instantly share code, notes, and snippets.

View matthhong's full-sized avatar

Matt-Heun Hong matthhong

View GitHub Profile
@mdml
mdml / README.md
Last active March 30, 2023 16:30
Dendrograms: Convert from Scipy to D3

A dendrogram is a common way to represent hierarchical data. For Python users, Scipy has a hierarchical clustering module that performs hierarchical clustering and outputs the results as dendrogram plots via matplotlib. When it's time to make a prettier, more customized, or web-version of the dendogram, however, it can be tricky to use Scipy's dendrogram to create a suitable visualization. My preferred method of visualizing data -- especially on the web -- is D3. This example includes a script to convert a Scipy dendrogram into JSON format used by D3's cluster method.

In the example, I cluster six genes by their expression values from two experiments. You can easily replace that data with your own, larger data set, to harness the power of both Scipy and D3 for analyzing hierarchical data. The D3 code I used to generate this example is straigh

@danwild
danwild / install_netcdf4.sh
Created November 4, 2016 00:53
Install netCDF4 in Ubuntu
#!/bin/bash
# Script to install hdf5 and netCDF4 libraries on a Linux Ubuntu system
# After: https://code.google.com/p/netcdf4-python/wiki/UbuntuInstall
# And http://unidata.github.io/netcdf4-python/
# You can check for newer version of the programs on
# ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/
# and other sources
@zendobk
zendobk / 01-install-nvidia-driver.sh
Last active May 30, 2022 02:55
Steps to install CUDA 10.0 on Ubuntu 18.04
#!/bin/bash
set -eo pipefail
# Purge existing drivers first if needed
sudo apt-get purge --auto-remove -y "nvidia*"
sudo ubuntu-drivers autoinstall
sudo apt-mark manual nvidia-prime nvidia-settings libnvidia-compute-440:i386 libnvidia-decode-440:i386 libnvidia-encode-440:i386 libnvidia-gl-440:i386