immersinn-ds

Wed 14 September 2016

Experimenting with Blog

Posted by TRII in posts-test   

Overview + Test Blog Entry Creation

Intro

Just testing the creation of a blog post. La de da.

This is mostly pulled from a Seaborn tutorial on categorical data stuffs.

Some Inital Stuff

In [1]:
%matplotlib inline
In [2]:
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
In [3]:
import seaborn as sns
sns.set(style="whitegrid", color_codes=True)
In [4]:
titanic = sns.load_dataset("titanic")
tips = sns.load_dataset("tips")
iris = sns.load_dataset("iris")

Dataframes, printing

In [5]:
iris.head(7)
Out[5]:
sepal_length sepal_width petal_length petal_width species
0 5.1 3.5 1.4 0.2 setosa
1 4.9 3.0 1.4 0.2 setosa
2 4.7 3.2 1.3 0.2 setosa
3 4.6 3.1 1.5 0.2 setosa
4 5.0 3.6 1.4 0.2 setosa
5 5.4 3.9 1.7 0.4 setosa
6 4.6 3.4 1.4 0.3 setosa
In [6]:
print('**'.join(['What', 'does', 'printing', 'looklike', '?']))
What**does**printing**looklike**?

Plotting Stuff

Breakdown of survival rates by gender, cabin, in plot form:

In [7]:
fig, ax = plt.subplots(figsize=(12,6))
sns.barplot(ax=ax, x="sex", y="survived", hue="class", data=titanic);

Equations and such

In [8]:
from IPython.display import display, Math, Latex
In [9]:
display(Math(r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx'))
$$F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx$$
In [10]:
%%latex
\begin{align}
\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\
\nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
\nabla \cdot \vec{\mathbf{B}} & = 0
\end{align}
\begin{align} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{align}