iPython Notebook

Simplicity is the final achievement. After one has played a vast quantity of notes and more notes, it is simplicity that emerges as the crowning reward of art.
Frédéric Chopin


HelloNotebook ————————————————————- HelloPython ————————————————————-













Hello World!

message = 'Hello World!'
!echo $message

Hello World!



print("Hello World!")

Hello World!













Displaying Images

from IPython.display import Image
Image(url='https://emptyencore.files.wordpress.com/2011/05/the-witcher-2-19121.jpg')














Displaying Equations

The compound interest formula states that:

where:

  • $P$ is the principal (initial investment).
  • $r$ is the annual interest rate, as a decimal.
  • $t$ is the time in years.
  • $e$ is the base of natural logarithms.
  • $R$ is the total return after $t$ years (including principal)













Cross Product Formula

\[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix}\]














Maxwell’s Equations

\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}














List Files using ls

ls

Anaconda-2.1.0-Linux-x86.sh*       HelloNotebook.ipynb  NotebookEssentials.ipynb  RISE-master.zip          Styling_notebooks.ipynb
Details                            Introduction         NotebookSetup.ipynb       SlideSample.ipynb
Evolution-of-Swarming-Experiment/  node-v0.12.0/        RISE-master/              SlideSample.slides.html













Import Audio

from IPython.display import Audio
Audio(url="http://www.nch.com.au/acm/8k16bitpcm.wav")





            <audio controls="controls" >
                <source src="http://www.nch.com.au/acm/8k16bitpcm.wav" type="audio/x-wav" />
                Your browser does not support the audio element.
            </audio>













Adding Video

from IPython.display import YouTubeVideo
YouTubeVideo('j9jbdgZidu8')





    <iframe
        width="400"
        height="300"
        src="https://www.youtube.com/embed/j9jbdgZidu8"
        frameborder="0"
        allowfullscreen
    ></iframe>













Embed External Websites

from IPython.display import IFrame
IFrame('http://www.dlsu.edu.ph/', width='100%', height=540)





    <iframe
        width="100%"
        height="540"
        src="http://www.dlsu.edu.ph/"
        frameborder="0"
        allowfullscreen
    ></iframe>













That’s it for now!

Written on March 13, 2015