In [1]:
%lsmagic
Out[1]:
Available line magics:
%alias  %alias_magic  %autoawait  %autocall  %automagic  %autosave  %bookmark  %cd  %clear  %cls  %colors  %conda  %config  %connect_info  %copy  %ddir  %debug  %dhist  %dirs  %doctest_mode  %echo  %ed  %edit  %env  %gui  %hist  %history  %killbgscripts  %ldir  %less  %load  %load_ext  %loadpy  %logoff  %logon  %logstart  %logstate  %logstop  %ls  %lsmagic  %macro  %magic  %matplotlib  %mkdir  %more  %notebook  %page  %pastebin  %pdb  %pdef  %pdoc  %pfile  %pinfo  %pinfo2  %pip  %popd  %pprint  %precision  %prun  %psearch  %psource  %pushd  %pwd  %pycat  %pylab  %qtconsole  %quickref  %recall  %rehashx  %reload_ext  %ren  %rep  %rerun  %reset  %reset_selective  %rmdir  %run  %save  %sc  %set_env  %store  %sx  %system  %tb  %time  %timeit  %unalias  %unload_ext  %who  %who_ls  %whos  %xdel  %xmode

Available cell magics:
%%!  %%HTML  %%SVG  %%bash  %%capture  %%cmd  %%debug  %%file  %%html  %%javascript  %%js  %%latex  %%markdown  %%perl  %%prun  %%pypy  %%python  %%python2  %%python3  %%ruby  %%script  %%sh  %%svg  %%sx  %%system  %%time  %%timeit  %%writefile

Automagic is ON, % prefix IS NOT needed for line magics.
In [11]:
%automagic ON
Automagic is ON, % prefix IS NOT needed for line magics.
In [14]:
d = {'US': 'USA', 'FR': 'France'}
res = 1 + 2
print(d)
res
{'US': 'USA', 'FR': 'France'}
Out[14]:
3
In [15]:
%page d
In [16]:
%pinfo d
In [21]:
a = 1; b = 2; test = 'Test'; test2 = 'Test2'
In [18]:
%who
a	 b	 c	 d	 res	 test	 test2	 
In [19]:
%who_ls
Out[19]:
['a', 'b', 'c', 'd', 'res', 'test', 'test2']
In [26]:
%whos
Variable   Type    Data/Info
----------------------------
a          int     1
d          dict    n=2
res        int     3
test       str     Test
test2      str     Test2
In [23]:
%reset_selective c
Once deleted, variables cannot be recovered. Proceed (y/[n])?  y
In [25]:
%reset_selective -f b
In [27]:
%reset
Once deleted, variables cannot be recovered. Proceed (y/[n])? n
Nothing done.
In [28]:
%reset -f
In [29]:
%whos
Interactive namespace is empty.
In [38]:
import time

start = time.time()
for i in range(1000000):
    pass
time.time() - start
Out[38]:
0.04288458824157715
In [42]:
%%time

for i in range(1000000):
    pass
Wall time: 46.2 ms
In [43]:
%%timeit

for i in range(1000000):
    pass
21.2 ms ± 1.19 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
In [44]:
%%html

<table class="table">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>Larry</td>
      <td>the Bird</td>
      <td>@twitter</td>
    </tr>
  </tbody>
</table>
# First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
In [45]:
%%html
<div class="embed-responsive embed-responsive-16by9">
  <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/zpOULjyy-n8?rel=0" allowfullscreen></iframe>
</div>
In [47]:
# %%js
# alert('Hi')
In [ ]: