-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsplom.py
More file actions
42 lines (31 loc) · 1.22 KB
/
splom.py
File metadata and controls
42 lines (31 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# plotly standard imports
import plotly.graph_objs as go
import chart_studio.plotly as py
# Cufflinks wrapper on plotly
import cufflinks
# Data science imports
import pandas as pd
import numpy as np
# Options for pandas
pd.options.display.max_columns = 30
df = pd.read_csv('data/blue_jays.csv', index_col=0)
df.head()
print(df)
from plotly.offline import iplot
import plotly.figure_factory as ff
figure = ff.create_scatterplotmatrix(df[['KnownSex', 'Head', 'Mass', 'Skull']],
index='KnownSex', height=800, width=800)
iplot(figure)
corrs = df.corr()
figure = ff.create_annotated_heatmap(z=corrs.round(2).values,
x = list(corrs.columns),
y = list(corrs.index),
showscale=True)
#iplot(figure)
figure = ff.create_scatterplotmatrix(df[['KnownSex', 'Head', 'Mass', 'Skull']], diag='histogram',
index='KnownSex', height=800, width=800)
#iplot(figure)
iplot(ff.create_violin(df, data_header='Mass',
group_header='KnownSex'))
figure = ff.create_dendrogram(df[['Mass', 'Skull']])
iplot(figure)