Requirements for a platform
iPython is a command shell for interactive computing. Brings the ease of use and tools of Python together with an interactive enviornment akin to Mathematica, MatLab etc.
Jupyter is a descendant of iPython. Jupyter is a web-notebook that can support iPython (and R, Ruby, besides others…Language Angostic). The Jupyter web-notebook allows you to create and share “documents” that contain live code, equations, visualizations and explanatory text.
In the last few years, assignments are being handed out (and graded) as ipython notebooks, books are being written as ipython notebooks, even the news article that you read in the morning may have used an ipython notebook! The data analysis tasks, in academia and in the industry are predominantly done using this platform.
In [22]:
import time, sys
for i in range(13):
time.sleep(0.1 * i)
print(i, end=' ')
sys.stdout.flush()
In [1]:
#!pwd
Euler's formula, named after Leonhard Euler, is a mathematical formula in complex analysis that establishes the fundamental relationship between the trigonometric functions and the complex exponential function. Euler's formula states that, for any real number $x$:
\begin{equation} e^{ix}=\cos x+i\sin x \end{equation}where $e$ is the base of the natural logarithm, $i$ is the imaginary unit, and $cos$ and $sin$ are the trigonometric functions cosine and sine respectively, with the argument $x$ given in radians. The formula is still valid if x is a complex number, and so some authors refer to the more general complex version as Euler's formula.
In [5]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from IPython.html.widgets import interact
from IPython.html import widgets
@interact(w=(0.1,10))
def illustrate_example(w=1):
t = np.linspace(0,2 * np.pi, 31 * w)
wt = w * t
e_iwt = np.e ** (1j * wt)
plt.plot(wt, e_iwt.real, label="$Re[e^{i \omega t}]$")
plt.plot(wt, np.cos(wt), 'o', label="$\cos(\omega t)$")
plt.plot(wt, e_iwt.imag, label="$Im[e^{i \omega t}]$")
plt.plot(wt, np.sin(wt), 'o', label="$\sin(\omega t)$")
plt.title("$e^{i \omega t} = \cos(\omega t) + i \sin(\omega t)$")
plt.legend(loc=0)
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: