day1/session2.tex
changeset 146 09efb6e419f5
parent 145 9d815e9e553a
child 151 55c22520ff5e
equal deleted inserted replaced
145:9d815e9e553a 146:09efb6e419f5
     1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     2 %Tutorial slides on Python.
     2 %Tutorial slides on Python.
     3 %
     3 %
     4 % Author: FOSSEE 
     4 % Author: The FOSSEE Group
     5 % Copyright (c) 2009, FOSSEE, IIT Bombay
     5 % Copyright (c) 2009, The FOSSEE Group, IIT Bombay
     6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     7 
     7 
     8 \documentclass[14pt,compress]{beamer}
     8 \documentclass[14pt,compress]{beamer}
     9 %\documentclass[draft]{beamer}
     9 %\documentclass[draft]{beamer}
    10 %\documentclass[compress,handout]{beamer}
    10 %\documentclass[compress,handout]{beamer}
    73 
    73 
    74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    75 % Title page
    75 % Title page
    76 \title[Plotting using Python]{Plotting experimental data\\}
    76 \title[Plotting using Python]{Plotting experimental data\\}
    77 
    77 
    78 \author[FOSSEE] {FOSSEE}
    78 \author[FOSSEE Team] {The FOSSEE Group}
    79 
    79 
    80 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
    80 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
    81 \date[] {31, October 2009\\Day 1, Session 2}
    81 \date[] {31, October 2009\\Day 1, Session 2}
    82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    83 
    83 
   121   \frametitle{Outline}
   121   \frametitle{Outline}
   122   \tableofcontents
   122   \tableofcontents
   123   % You might wish to add the option [pausesections]
   123   % You might wish to add the option [pausesections]
   124 \end{frame}
   124 \end{frame}
   125 
   125 
   126 \section{Functions}
       
   127 \begin{frame}{Functions: Definition}
       
   128 \begin{itemize}
       
   129   \item \kwrd{def} keyword
       
   130 \end{itemize}
       
   131 \end{frame}
       
   132 
       
   133 \begin{frame}[fragile]
       
   134 \frametitle{Functions: Example 1}
       
   135   \begin{lstlisting}
       
   136 In []: def plot_sinx():
       
   137    ....:     x = linspace(0, 2*pi, 100)
       
   138    ....:     plt.plot(x, sin(x))
       
   139    ....:     plt.show()
       
   140    ....:    
       
   141 
       
   142 In []: plot_sinx()
       
   143   \end{lstlisting}
       
   144 \end{frame}
       
   145 
       
   146 \begin{frame}[fragile]
       
   147 \frametitle{Functions: Example 2}
       
   148   \begin{lstlisting}
       
   149 In []: def f(x):
       
   150    ....:     return sin(x*x*x)+(3*x*x)
       
   151 
       
   152 In []: x = linspace(0,2*pi, 1000)
       
   153 
       
   154 In []: plt.plot(x, f(x))
       
   155   \end{lstlisting}
       
   156   \inctime{10}
       
   157 \end{frame}
       
   158 
       
   159 \section{Creating and running scripts}
   126 \section{Creating and running scripts}
   160 \begin{frame}
   127 \begin{frame}
   161   {Creating python files}
   128   {Creating python files}
   162   \begin{itemize}
   129   \begin{itemize}
   163     \item use your editor
   130     \item use your editor
   254 Out[]: [1, 2, 3, 4, 5, [6, 7]]
   221 Out[]: [1, 2, 3, 4, 5, [6, 7]]
   255 \end{lstlisting}
   222 \end{lstlisting}
   256 \inctime{10}
   223 \inctime{10}
   257 \end{frame}
   224 \end{frame}
   258 
   225 
   259 \section{Modules and import}
       
   260 \begin{frame}{Modules and \typ{import}}
       
   261   \begin{itemize}
       
   262     \item \kwrd{import} x
       
   263     \item \kwrd{from} x \kwrd{import} y
       
   264   \end{itemize}
       
   265 \pause
       
   266 Whats the difference??
       
   267 \inctime{5}
       
   268 \end{frame}
       
   269 
       
   270 \end{document}
   226 \end{document}