#!/usr/bin/env python # coding: utf-8 # ------------------------------------------------------------- # # <pre> <span class="hgviolet"> iPython Notebook Intro </span> # <p style="text-align: center;"><i class="icon-github icon-2x"> [melvincabatuan](https://github.com/melvincabatuan)</i></p> # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # # <span> Hello World! </span> # In[2]: message = 'Hello World!' get_ipython().system('echo $message') # In[3]: print("Hello World!") # ------------------------------------------------------------- # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span class="hgviolet"> Displaying Images </span> # In[14]: from IPython.display import Image Image(url='https://emptyencore.files.wordpress.com/2011/05/the-witcher-2-19121.jpg') # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span> Displaying Equations </span> # The *compound interest* formula states that: # # $$ R = Pe^{rt} $$ # # 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) # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span> Cross Product Formula </span> # \begin{equation} # \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} # \end{equation} # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span> Maxwell's Equations </span> # \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} # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span> List Files using ls </span> # In[5]: ls # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span> Import Audio </span> # In[6]: from IPython.display import Audio Audio(url="http://www.nch.com.au/acm/8k16bitpcm.wav") # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span> Adding Video </span> # In[7]: from IPython.display import YouTubeVideo YouTubeVideo('j9jbdgZidu8') # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span> Embed External Websites </span> # In[8]: from IPython.display import IFrame IFrame('http://www.dlsu.edu.ph/', width='100%', height=540) # ------------------------------------------------------------- # # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # <br/> # # <span> That's it for now! </span>