additional_ipython/slides.org
author Nishanth <nishanth@fossee.in>
Mon, 11 Oct 2010 13:42:52 +0530
changeset 297 bef342784a40
parent 271 bb4ed72f3ec6
permissions -rw-r--r--
removed redundant scripts
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
271
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     1
#+LaTeX_CLASS: beamer
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     2
#+LaTeX_CLASS_OPTIONS: [presentation]
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
#+BEAMER_FRAME_LEVEL: 1
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     5
#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     6
#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     7
#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     8
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     9
#+LaTeX_CLASS: beamer
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    10
#+LaTeX_CLASS_OPTIONS: [presentation]
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    11
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    12
#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    13
#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    14
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    15
#+LaTeX_HEADER:\usepackage{listings}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    16
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    17
#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    18
#+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    19
#+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    20
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    21
#+TITLE:    Additional Features of =ipython=
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    22
#+AUTHOR:    FOSSEE
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    23
#+EMAIL:     
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    24
#+DATE:    
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    25
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    26
#+DESCRIPTION: 
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    27
#+KEYWORDS: 
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    28
#+LANGUAGE:  en
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    29
#+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    30
#+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    31
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    32
* Outline
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    33
  + Retrieving ipython history 
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    34
  + Viewing a part of the history 
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    35
  + Saving (relevant) parts of the history to a file
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    36
  + Running a script from within ipython 
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    37
* Question 1
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    38
  Read through the documentation of ~%hist~ and find out how to list
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    39
  all the commands between 5 and 10
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    40
* Solution 1
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    41
  #+begin_src python
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    42
    In []: %hist 5 10
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    43
  #+end_src
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    44
* Question 2
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    45
  Change the label on y-axis to "y" and save the lines of code
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    46
  accordingly
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    47
* Solution 2
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    48
  #+begin_src python
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    49
    In []: ylabel("y")
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    50
    In []: %save /home/fossee/example_plot.py 1 3-6 10
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    51
  #+end_src
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    52
* Question 3
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    53
  Use =%hist= and =%save= and create a script that has show in it and
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    54
  run it to produce and show the plot.
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    55
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    56
* Solution 3
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    57
  #+begin_src python
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    58
    In []: %hist 20
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    59
        
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    60
    In []: %save /home/fossee/show_included.py 1 3-6 8 10 13
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    61
    In []: %run -i /home/fossee/show_included.py
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    62
  #+end_src
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    63
* Question 4
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    64
  Run the script without using the -i option. Do you find any
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    65
  difference?
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    66
* Solution 4
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    67
  We see that it raises ~NameError~ saying the name ~linspace~ is not
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    68
  found.
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    69
* Summary
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    70
  + Retreiving history using =%hist= command
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    71
  + Vieweing only a part of history by passing an argument to %hist
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    72
  + Saving the required lines of code in required order using %save
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    73
  + Using %run -i command to run the saved script
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    74
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    75
* Thank you!
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    76
#+begin_latex
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    77
  \begin{block}{}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    78
  \begin{center}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    79
  This spoken tutorial has been produced by the
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    80
  \textcolor{blue}{FOSSEE} team, which is funded by the 
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    81
  \end{center}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    82
  \begin{center}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    83
    \textcolor{blue}{National Mission on Education through \\
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    84
      Information \& Communication Technology \\ 
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    85
      MHRD, Govt. of India}.
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    86
  \end{center}  
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    87
  \end{block}
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    88
#+end_latex
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    89
bb4ed72f3ec6 Slides for additional ipython LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    90