In [1]:
# Magics first (server issues)
%matplotlib inline
# Do below if you want interactive matplotlib plot ()
# %matplotlib notebook
# https://ipython.org/ipython-doc/dev/config/extensions/autoreload.html
%load_ext autoreload
%autoreload 2
# %install_ext http://raw.github.com/jrjohansson/version_information/master/version_information.py
%load_ext version_information
%version_information numpy, scipy, matplotlib, pandas
Out[1]:
In [2]:
# Standard library
import os
import sys
sys.path.append("../src/")
# Third party imports
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
# Local imports
from simpleexample import example_func
In [3]:
# Customizations
sns.set() # matplotlib defaults
# Any tweaks that normally go in .matplotlibrc, etc., should explicitly go here
plt.rcParams['figure.figsize'] = (12, 12)
%config InlineBackend.figure_format='retina'
In [10]:
# Find the notebook the saved figures came from
fig_prefix = "../figures/2015-07-24-jw-"
In [4]:
from IPython.display import FileLink
FileLink("../deliver/coal_data_cleanup.ipynb")
Out[4]:
In [5]:
dframe = pd.read_csv("../data/coal_prod_cleaned.csv")
In [6]:
plt.scatter(dframe['Year'], dframe['Production_short_tons'])
Out[6]:
In [7]:
df2 = dframe.groupby('Mine_State').sum()
In [8]:
df2 = df2[df2.index != 'Wyoming']
In [11]:
sns.jointplot('Labor_Hours', 'Production_short_tons', data=df2, kind="reg", )
plt.xlabel("Labor Hours Worked")
plt.ylabel("Total Amount Produced")
plt.tight_layout()
plt.savefig(fig_prefix + "production-vs-hours-worked.png")
In [ ]:
In [ ]:
In [23]:
%load_ext autoreload
%autoreload 2
In [24]:
import sys
sys.path.append("../src/")
In [26]:
from simpleexample import example_func
example_func()
Out[26]:
In [27]:
example_func()
Out[27]:
In [ ]: