Jupyter Notebook デモ

Markdownサンプル

$$e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i$$
def sayhello():
    print('Hello World')

# Let's say hello
sayhello()
In [2]:
import numpy as np
from matplotlib import pyplot as plt
import math
%matplotlib inline
In [5]:
x = np.arange(0, math.pi*4, 0.01)

y1 = np.sin(x)
y2 = np.cos(x)

print('x:', x[:5])
print('sin(x):', y1[:5])
print('cos(x):', y2[:5])
x: [0.   0.01 0.02 0.03 0.04]
sin(x): [0.         0.00999983 0.01999867 0.0299955  0.03998933]
cos(x): [1.         0.99995    0.99980001 0.99955003 0.99920011]
In [6]:
plt.plot(x, y1)
plt.plot(x, y2)
Out[6]:
[<matplotlib.lines.Line2D at 0x11d87cf40>]