Published
Edited
Nov 9, 2021
2 forks
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
// choose your dataset
//////////////////////////////
// csv_string = FileAttachment("10K_random.csv").text()
// csv_string = FileAttachment("1M_random.csv").text()
csv_string = FileAttachment("ccle_data_observable.csv").text()
// csv_string = FileAttachment("rc_two_cat_clean.csv").text()
Insert cell
Insert cell
run_clustergrammer = {
py`
import micropip
micropip.install(['clustergrammer2_core==0.3.0'])
`
var run_clustergrammer = py`
import micropip
import pandas as pd
import scipy
import sklearn
import statsmodels
import matplotlib
import json
from io import StringIO
from clustergrammer2_core import net

def run_clustergrammer(csv_string):
df = pd.read_csv(StringIO(csv_string), sep=",", index_col=0)
net.load_df(df)

# Z-Score Data
#########################
net.normalize(axis='row', norm_type='zscore')

net.cluster()
return json.dumps(net.viz)
run_clustergrammer
`
return run_clustergrammer
}
Insert cell
network = JSON.parse(run_clustergrammer(csv_string))
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more