Plotting and statistical packages

  • Matplotlib / Seaborn
  • pandas
  • statsmodels

In [1]:
%matplotlib inline

import matplotlib.pyplot as plt
import seaborn as sns

import pandas as pd
import numpy as np

from sklearn.datasets import load_boston

import statsmodels.api as sm
from statsmodels.formula.api import ols

sns.set()


/Users/jbw/anaconda/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]:
# Load the example Titanic dataset
titanic = sns.load_dataset("titanic")

In [4]:
g = sns.factorplot(x="class", y="survived", data=titanic, 
                   hue="sex", 
                   size=6, kind="bar", palette="muted")

g.set_ylabels("survival probability")


Out[4]:
<seaborn.axisgrid.FacetGrid at 0x10c053450>

In [ ]: