In [144]:
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import plotly.plotly as py
from plotly.graph_objs import *
import plotly.tools as tls

In [117]:
df = pd.read_csv('disc.csv', sep=' ')

In [118]:
df


Out[118]:
Human Decisive Interactive Stability Cautious
0 Greg 10 99 99 77
1 Dave 42 46 88 67
2 Fisch 49 28 88 77
3 Damon 35 60 77 67
4 Kimberly 21 46 88 99
5 Magnus 25 67 88 53
6 Jay 21 53 88 88
7 Madison 56 53 46 77
8 Jason 67 39 39 99
9 Abdullah 56 81 46 46
10 Bill 81 28 46 88
11 Rich 49 60 63 53
12 Ann 99 28 53 67
13 Ryan 99 99 53 14
14 Curtis 56 67 77 32
15 Pasha 56 81 53 39
16 Mandi 56 39 88 53
17 Kirk 56 28 63 88
18 Trevor 99 99 53 14
19 Marti 67 11 88 99
20 Tyler 67 67 39 53
21 Artem 35 99 53 53
22 Sam 49 81 53 46
23 Emily 35 81 77 46

In [119]:
df.describe()


Out[119]:
Decisive Interactive Stability Cautious
count 24.000000 24.000000 24.000000 24.000000
mean 53.583333 60.000000 66.916667 62.291667
std 24.305871 26.262885 19.235196 24.753531
min 10.000000 11.000000 39.000000 14.000000
25% 35.000000 39.000000 53.000000 46.000000
50% 56.000000 60.000000 63.000000 60.000000
75% 67.000000 81.000000 88.000000 79.750000
max 99.000000 99.000000 99.000000 99.000000

In [124]:
fig1 = df.hist(bins=6)



In [123]:
fig2 = df.plot(kind='bar', stacked=True, x='Human' )



In [137]:
fig3 = df.plot(kind='box')



In [138]:
fig3


Out[138]:
<matplotlib.axes._subplots.AxesSubplot at 0x1179eb6d0>

In [140]:
fig4 = plt.figure()


<matplotlib.figure.Figure at 0x117b2abd0>

In [145]:
tls.mpl_to_plotly(fig3)


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-145-7509a9abc870> in <module>()
----> 1 tls.mpl_to_plotly(fig3)

/usr/local/lib/python2.7/site-packages/plotly/tools.pyc in mpl_to_plotly(fig, resize, strip_style, verbose)
    376     if _matplotlylib_imported:
    377         renderer = matplotlylib.PlotlyRenderer()
--> 378         matplotlylib.Exporter(renderer).run(fig)
    379         if resize:
    380             renderer.resize()

/usr/local/lib/python2.7/site-packages/plotly/matplotlylib/mplexporter/exporter.pyc in run(self, fig)
     43         # Calling savefig executes the draw() command, putting elements
     44         # in the correct place.
---> 45         fig.savefig(io.BytesIO(), format='png', dpi=fig.dpi)
     46         if self.close_mpl:
     47             import matplotlib.pyplot as plt

AttributeError: 'AxesSubplot' object has no attribute 'savefig'

In [91]:
df.median()


Out[91]:
Decisive       56
Interactive    60
Stability      63
Cautious       60
dtype: float64

In [100]:
df[df.Decisive > 70].sort('Decisive', ascending=False)


Out[100]:
Human Decisive Interactive Stability Cautious
12 Ann 99 28 53 67
13 Ryan 99 99 53 14
18 Trevor 99 99 53 14
10 Bill 81 28 46 88

In [101]:
df[df.Interactive > 70].sort('Interactive', ascending=False)


Out[101]:
Human Decisive Interactive Stability Cautious
0 Greg 10 99 99 77
13 Ryan 99 99 53 14
18 Trevor 99 99 53 14
21 Artem 35 99 53 53
9 Abdullah 56 81 46 46
15 Pasha 56 81 53 39
22 Sam 49 81 53 46
23 Emily 35 81 77 46

In [102]:
df[df.Stability > 70].sort('Stability', ascending=False)


Out[102]:
Human Decisive Interactive Stability Cautious
0 Greg 10 99 99 77
1 Dave 42 46 88 67
2 Fisch 49 28 88 77
4 Kimberly 21 46 88 99
5 Magnus 25 67 88 53
6 Jay 21 53 88 88
16 Mandi 56 39 88 53
19 Marti 67 11 88 99
3 Damon 35 60 77 67
14 Curtis 56 67 77 32
23 Emily 35 81 77 46

In [103]:
df[df.Cautious > 70].sort('Cautious', ascending=False)


Out[103]:
Human Decisive Interactive Stability Cautious
4 Kimberly 21 46 88 99
8 Jason 67 39 39 99
19 Marti 67 11 88 99
6 Jay 21 53 88 88
10 Bill 81 28 46 88
17 Kirk 56 28 63 88
0 Greg 10 99 99 77
2 Fisch 49 28 88 77
7 Madison 56 53 46 77

In [76]:
df.groupby('Cautious').sum()


Out[76]:
Decisive Interactive Stability
Cautious
14 198 198 106
32 56 67 77
39 56 81 53
46 140 243 176
53 232 332 331
67 176 134 218
77 115 180 233
88 158 109 197
99 155 96 215

In [ ]: