Trial python blog using jupyter

Posted on Thu 03 September 2015 in blog

Purpose This is the first iPython notebook I'm adding online. The goal of this notebook is more to learn the syntax, etc, and to migrate content online. For example, one asterisk makes text italic. Two asterisks makes text bold. Putting 2 dollar signs before and after an expression gives an equation:

$$y=10*x$$

An equation can be displayed inline with the text by adding a single dollar sign on either side of the expression, like so: $y=sin(x)$

This is a good website to remember for markdown: http://nestacms.com/docs/creating-content/markdown-cheat-sheet

And for when you come up with something quotable, use a greater-than key

Be inspired!

Okay, now on to some plots! First, load the dependencies

In [1]:
import pandas as pd
import numpy as np
import matplotlib as plt
import matplotlib.pylab as plt
from sklearn import linear_model
#import statsmodels.api as sm
%matplotlib inline

Now generate a dataset of a line with some noise built in and see what it looks like...

In [2]:
#Set a randomization seed for reproducibility
np.random.seed(1)
d = np.arange(0,10,0.1)
df = pd.DataFrame({'x': d})
df['y']=df['x']*0.5+2 + np.random.randn(len(d))
In [4]:
plt.plot(df['x'],df['y'])
plt.show()

Jupyter makes it really easy to illustrate code, plots, and descriptions together!