day2/session2.tex
changeset 35 a49b340696ba
child 36 8047755ae660
equal deleted inserted replaced
34:5218871f98f4 35:a49b340696ba
       
     1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
     2 % Tutorial slides on Python.
       
     3 %
       
     4 % Author: Prabhu Ramachandran <prabhu at aero.iitb.ac.in>
       
     5 % Copyright (c) 2005-2008, Prabhu Ramachandran
       
     6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
     7 
       
     8 \documentclass[14pt,compress]{beamer}
       
     9 %\documentclass[draft]{beamer}
       
    10 %\documentclass[compress,handout]{beamer}
       
    11 %\usepackage{pgfpages} 
       
    12 %\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
       
    13 
       
    14 % Modified from: generic-ornate-15min-45min.de.tex
       
    15 \mode<presentation>
       
    16 {
       
    17   \usetheme{Warsaw}
       
    18   \useoutertheme{split}
       
    19   \setbeamercovered{transparent}
       
    20 }
       
    21 
       
    22 \usepackage[english]{babel}
       
    23 \usepackage[latin1]{inputenc}
       
    24 %\usepackage{times}
       
    25 \usepackage[T1]{fontenc}
       
    26 
       
    27 % Taken from Fernando's slides.
       
    28 \usepackage{ae,aecompl}
       
    29 \usepackage{mathpazo,courier,euler}
       
    30 \usepackage[scaled=.95]{helvet}
       
    31 
       
    32 \definecolor{darkgreen}{rgb}{0,0.5,0}
       
    33 
       
    34 \usepackage{listings}
       
    35 \lstset{language=Python,
       
    36     basicstyle=\ttfamily\bfseries,
       
    37     commentstyle=\color{red}\itshape,
       
    38   stringstyle=\color{darkgreen},
       
    39   showstringspaces=false,
       
    40   keywordstyle=\color{blue}\bfseries}
       
    41 
       
    42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
    43 % Macros
       
    44 \setbeamercolor{emphbar}{bg=blue!20, fg=black}
       
    45 \newcommand{\emphbar}[1]
       
    46 {\begin{beamercolorbox}[rounded=true]{emphbar} 
       
    47       {#1}
       
    48  \end{beamercolorbox}
       
    49 }
       
    50 \newcounter{time}
       
    51 \setcounter{time}{0}
       
    52 \newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
       
    53 
       
    54 \newcommand{\typ}[1]{\lstlisting{#1}}
       
    55 
       
    56 \newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
       
    57 
       
    58 %%% This is from Fernando's setup.
       
    59 % \usepackage{color}
       
    60 % \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
       
    61 % % Use and configure listings package for nicely formatted code
       
    62 % \usepackage{listings}
       
    63 % \lstset{
       
    64 %    language=Python,
       
    65 %    basicstyle=\small\ttfamily,
       
    66 %    commentstyle=\ttfamily\color{blue},
       
    67 %    stringstyle=\ttfamily\color{orange},
       
    68 %    showstringspaces=false,
       
    69 %    breaklines=true,
       
    70 %    postbreak = \space\dots
       
    71 % }
       
    72 
       
    73 
       
    74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
    75 % Title page
       
    76 \title[]{Matrices and Arrays\\ \& \\2D Plotting}
       
    77 
       
    78 \author[FOSSEE Team] {Asokan Pichai\\Prabhu Ramachandran}
       
    79 
       
    80 \institute[FOSSEE] {FOSSEE Team}
       
    81 \date[] {11, October 2009}
       
    82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
    83 
       
    84 %\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
       
    85 %\logo{\pgfuseimage{iitmlogo}}
       
    86 
       
    87 
       
    88 %% Delete this, if you do not want the table of contents to pop up at
       
    89 %% the beginning of each subsection:
       
    90 \AtBeginSubsection[]
       
    91 {
       
    92   \begin{frame}<beamer>
       
    93     \frametitle{Outline}
       
    94     \tableofcontents[currentsection,currentsubsection]
       
    95   \end{frame}
       
    96 }
       
    97 
       
    98 \AtBeginSection[]
       
    99 {
       
   100   \begin{frame}<beamer>
       
   101     \frametitle{Outline}
       
   102     \tableofcontents[currentsection,currentsubsection]
       
   103   \end{frame}
       
   104 }
       
   105 
       
   106 % If you wish to uncover everything in a step-wise fashion, uncomment
       
   107 % the following command: 
       
   108 %\beamerdefaultoverlayspecification{<+->}
       
   109 
       
   110 %\includeonlyframes{current,current1,current2,current3,current4,current5,current6}
       
   111 
       
   112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   113 % DOCUMENT STARTS
       
   114 \begin{document}
       
   115 
       
   116 \begin{frame}[fragile]
       
   117   \frametitle{Advanced}
       
   118   \begin{itemize}
       
   119   \item Only scratched the surface of \num
       
   120   \item Ufunc methods: \typ{reduce, accumulate, outer, reduceat}
       
   121   \item Typecasting
       
   122   \item More functions: \typ{take, choose, where, compress,
       
   123       concatenate}
       
   124   \item Array broadcasting and \typ{None}
       
   125   \end{itemize}
       
   126 \end{frame}
       
   127 
       
   128 \begin{frame}
       
   129     {Intro to SciPy}
       
   130   \begin{itemize}
       
   131   \item \url{http://www.scipy.org}
       
   132   \item Open source scientific libraries for Python
       
   133   \item Based on NumPy
       
   134     \end{itemize}
       
   135 
       
   136     \inctime{25}
       
   137 \end{frame}
       
   138 
       
   139 \begin{frame}
       
   140   \frametitle{SciPy}
       
   141   \begin{itemize}
       
   142   \item Provides:
       
   143     \begin{itemize}
       
   144     \item Linear algebra
       
   145     \item Numerical integration
       
   146     \item Fourier transforms
       
   147     \item Signal processing
       
   148     \item Special functions
       
   149     \item Statistics
       
   150     \item Optimization
       
   151     \item Image processing
       
   152     \item ODE solvers
       
   153     \end{itemize}
       
   154   \item Uses LAPACK, QUADPACK, ODEPACK, FFTPACK etc. from netlib
       
   155   \end{itemize}
       
   156 \end{frame}
       
   157 
       
   158 \end{document}
       
   159 
       
   160 - Numpy arrays (30 mins)
       
   161     - Matrices
       
   162     - random number generation.
       
   163     - Image manipulation: jigsaw puzzle.
       
   164     - Monte-carlo integration.
       
   165 
       
   166 
       
   167 \subsection{SciPy}
       
   168 
       
   169 \begin{frame}
       
   170   \frametitle{Using \texttt{SciPy}}
       
   171   \begin{itemize}
       
   172   \item SciPy is Open Source software for mathematics, science, and
       
   173     engineering
       
   174   \item \typ{import scipy}
       
   175   \item Built on NumPy
       
   176   \item Provides modules for statistics, optimization, integration,
       
   177     linear algebra, Fourier transforms, signal and image processing,
       
   178     genetic algorithms, ODE solvers, special functions, and more
       
   179   \item Used widely by scientists world over
       
   180   \item Details are beyond the scope of this tutorial
       
   181   \end{itemize}
       
   182 \end{frame}
       
   183