In [1]:
# alias startnb='wget --output-document=`date +%Y-%m-%d`.ipynb http://bit.ly/jupyter-start-nb2'
%load_ext autoreload
%autoreload 2
%matplotlib inline
%config InlineBackend.figure_format='retina' 

from __future__ import division

from itertools import combinations
import string

from IPython.display import IFrame, HTML, YouTubeVideo
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy as sp
import seaborn as sns; sns.set();

sns.set_style("darkgrid")
sns.set_context("poster", font_scale=1.3)

mpl_update = {'font.size':16,
              'xtick.labelsize':14,
              'ytick.labelsize':14,
              'figure.figsize':[12.0,8.0],
              'axes.color_cycle':['#0055A7', 
                                  '#2C3E4F', 
                                  '#26C5ED', 
                                  '#00cc66', 
                                  '#D34100', 
                                  '#FF9700',
                                  '#091D32',
                                 ], 
              'axes.labelsize':20,
              'axes.labelcolor':'#677385',
              'axes.titlesize':20,
              'lines.color':'#0055A7',
              'lines.linewidth':3,
              'text.color':'#677385'}

plt.rcParams.update(mpl_update)


/Users/jonathan/anaconda/envs/anaconda_r/lib/python2.7/site-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))

In [2]:
rows = 20
df = pd.DataFrame(data=np.random.randint(0, 6, (rows, 10)), 
                  index=[x for x in string.ascii_letters[:rows]])
df['num_missing'] = (df.iloc[:, 0:4] == 0).sum(1)
df['num_bad_ratings'] = (df.iloc[:, 0:4] <= 3).sum(1)
df.head()

# If this path doesn't exist, create it (matches Paul's standards request).
import sys
sys.path.append('../src/main/python/')

In [3]:
df


Out[3]:
0 1 2 3 4 5 6 7 8 9 num_missing num_bad_ratings
a 5 4 1 5 1 3 0 2 5 2 0 1
b 2 5 0 0 1 1 4 4 1 2 2 3
c 0 2 2 1 2 5 0 3 5 4 1 4
d 0 0 4 0 0 3 4 3 2 1 3 3
e 2 4 4 0 4 5 2 3 0 5 1 2
f 1 0 4 0 5 1 1 3 2 0 2 3
g 3 3 4 2 0 1 2 5 4 3 0 3
h 4 2 4 1 3 1 0 3 3 4 0 2
i 1 2 2 5 5 0 1 2 2 0 0 3
j 1 5 4 0 1 4 0 2 3 1 1 2
k 5 5 2 5 5 1 5 5 4 1 0 1
l 4 3 4 2 5 2 2 1 4 4 0 2
m 4 5 5 5 0 5 3 0 3 4 0 0
n 2 1 5 2 2 4 3 2 3 5 0 3
o 3 4 5 0 5 5 5 1 1 5 1 2
p 2 0 5 0 3 1 5 5 2 4 2 3
q 0 3 2 1 0 0 4 5 0 3 1 4
r 1 0 3 5 1 4 1 5 3 4 1 3
s 4 1 2 4 3 4 4 1 1 2 0 2
t 1 1 0 1 0 3 1 3 0 2 1 4

In [ ]: