day2/session3.tex
author Shantanu <shantanu@fossee.in>
Wed, 23 Dec 2009 14:17:02 +0530
changeset 331 c1bfec797af6
parent 330 46533051b9d3
child 339 8ac5fe07810f
permissions -rw-r--r--
Added images of ode results in session 5.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     2
%Tutorial slides on Python.
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     3
%
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     4
% Author: FOSSEE 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     5
% Copyright (c) 2009, FOSSEE, IIT Bombay
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     7
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     8
\documentclass[14pt,compress]{beamer}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     9
%\documentclass[draft]{beamer}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    10
%\documentclass[compress,handout]{beamer}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    11
%\usepackage{pgfpages} 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    12
%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    13
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    14
% Modified from: generic-ornate-15min-45min.de.tex
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    15
\mode<presentation>
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    16
{
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    17
  \usetheme{Warsaw}
239
8953675dc056 Added slide numbers.
Puneeth Chaganti <punchagan@fossee.in>
parents: 220
diff changeset
    18
  \useoutertheme{infolines}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    19
  \setbeamercovered{transparent}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    20
}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    21
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    22
\usepackage[english]{babel}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    23
\usepackage[latin1]{inputenc}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    24
%\usepackage{times}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    25
\usepackage[T1]{fontenc}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    26
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    27
% Taken from Fernando's slides.
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    28
\usepackage{ae,aecompl}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    29
\usepackage{mathpazo,courier,euler}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    30
\usepackage[scaled=.95]{helvet}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    31
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    32
\definecolor{darkgreen}{rgb}{0,0.5,0}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    33
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    34
\usepackage{listings}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    35
\lstset{language=Python,
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    36
    basicstyle=\ttfamily\bfseries,
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    37
    commentstyle=\color{red}\itshape,
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    38
  stringstyle=\color{darkgreen},
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    39
  showstringspaces=false,
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    40
  keywordstyle=\color{blue}\bfseries}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    41
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    42
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    43
% Macros
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    44
\setbeamercolor{emphbar}{bg=blue!20, fg=black}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    45
\newcommand{\emphbar}[1]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    46
{\begin{beamercolorbox}[rounded=true]{emphbar} 
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    47
      {#1}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    48
 \end{beamercolorbox}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    49
}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    50
\newcounter{time}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    51
\setcounter{time}{0}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    52
\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    53
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
    54
\newcommand{\typ}[1]{\lstinline{#1}}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    55
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    56
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    57
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    58
%%% This is from Fernando's setup.
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    59
% \usepackage{color}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    60
% \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    61
% % Use and configure listings package for nicely formatted code
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    62
% \usepackage{listings}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    63
% \lstset{
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    64
%    language=Python,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    65
%    basicstyle=\small\ttfamily,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    66
%    commentstyle=\ttfamily\color{blue},
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    67
%    stringstyle=\ttfamily\color{orange},
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    68
%    showstringspaces=false,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    69
%    breaklines=true,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    70
%    postbreak = \space\dots
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    71
% }
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    72
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    73
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    74
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    75
% Title page
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
    76
\title[Basic Python]{Python language: Functions, modules and objects}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    77
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    78
\author[FOSSEE Team] {The FOSSEE Group}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    79
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    80
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
330
46533051b9d3 commited changes made for scipy and cheatsheats.
Shantanu <shantanu@fossee.in>
parents: 300
diff changeset
    81
\date[] {15 December, 2009\\Day 2, Session 3}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    82
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    83
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    84
%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    85
%\logo{\pgfuseimage{iitmlogo}}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    86
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    87
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    88
%% Delete this, if you do not want the table of contents to pop up at
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    89
%% the beginning of each subsection:
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    90
\AtBeginSubsection[]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    91
{
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    92
  \begin{frame}<beamer>
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    93
    \frametitle{Outline}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    94
    \tableofcontents[currentsection,currentsubsection]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    95
  \end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    96
}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    97
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    98
\AtBeginSection[]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    99
{
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   100
  \begin{frame}<beamer>
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   101
    \frametitle{Outline}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   102
    \tableofcontents[currentsection,currentsubsection]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   103
  \end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   104
}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   105
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   106
% If you wish to uncover everything in a step-wise fashion, uncomment
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   107
% the following command: 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   108
%\beamerdefaultoverlayspecification{<+->}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   109
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   110
%\includeonlyframes{current,current1,current2,current3,current4,current5,current6}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   111
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   112
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   113
% DOCUMENT STARTS
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   114
\begin{document}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   115
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   116
\begin{frame}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   117
  \titlepage
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   118
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   119
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   120
\begin{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   121
  \frametitle{Outline}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   122
  \tableofcontents
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   123
  % You might wish to add the option [pausesections]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   124
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   125
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   126
\section{Functions}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   127
\subsection{Default arguments}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   128
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   129
  \frametitle{Functions: default arguments}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   130
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   131
In []: greet = 'hello world'
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   132
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   133
In []: greet.split()
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   134
Out[]: ['hello', 'world']
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   135
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   136
In []: line = 'Rossum, Guido, 54, 46, 55'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   137
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   138
In []: line.split(',')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   139
Out[]: ['Rossum', ' Guido', ' 54',
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   140
                        ' 46', ' 55']
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   141
  \end{lstlisting}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   142
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   143
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   144
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   145
  \frametitle{Functions: default arguments \ldots}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   146
  \begin{lstlisting}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   147
In []: def welcome(greet, name="World"):
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   148
  ....     print greet, name
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   149
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   150
In []: welcome("Hello")
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   151
Hello World
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   152
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   153
In []: welcome("Hi", "Guido")
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   154
Hi Guido
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   155
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   156
\end{frame} 
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   157
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   158
\subsection{Keyword arguments}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   159
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   160
  \frametitle{Functions: Keyword arguments}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   161
We have seen the following
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   162
\begin{lstlisting}
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   163
In []: legend(['sin(2y)'], 
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   164
                 loc = 'center')
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   165
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   166
In []: plot(y, sin(y), 'g',
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   167
                 linewidth = 2)
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   168
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   169
In []: annotate('local max',
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   170
                 xy = (1.5, 1))
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   171
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   172
In []: pie(science.values(),
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   173
            labels = science.keys())
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   174
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   175
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   176
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   177
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   178
  \frametitle{Functions: keyword arguments \ldots}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   179
  \begin{lstlisting}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   180
In []: def welcome(greet, name="World"):
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   181
  ....     print greet, name
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   182
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   183
In []: welcome("Hello", "James")
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   184
Hello James
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   185
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   186
In []: welcome("Hi", name="Guido")
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   187
Hi Guido
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   188
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   189
In []: welcome(name="Guido", greet="Hey")
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   190
Hey Guido
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   191
  \end{lstlisting}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   192
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   193
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   194
\subsection{Built-in functions}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   195
\begin{frame}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   196
  {Before writing a function}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   197
  \begin{itemize}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   198
      \item Variety of built-in functions are available
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   199
      \item \typ{abs, any, all, len, max, min}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   200
      \item \typ{pow, range, sum, type}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   201
      \item Refer here:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   202
          \url{http://docs.python.org/library/functions.html}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   203
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   204
  \inctime{10} 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   205
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   206
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   207
\subsection{Exercises}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   208
\begin{frame}{Problem set 3: Problem 3.1}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   209
  Write a function to return the gcd of two numbers.
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   210
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   211
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   212
\begin{frame}{Problem 3.2}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   213
Write a program to print all primitive pythagorean triads (a, b, c) where a, b are in the range 1---100 \\
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   214
A pythagorean triad $(a,b,c)$ has the property $a^2 + b^2 = c^2$.\\By primitive we mean triads that do not `depend' on others. For example, (4,3,5) is a variant of (3,4,5) and hence is not primitive. And (10,24,26) is easily derived from (5,12,13) and is also not primitive.
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   215
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   216
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   217
\begin{frame}{Problem 3.3}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   218
  Write a program that generates a list of all four digit numbers that have all their digits even and are perfect squares.\newline\\\emph{For example, the output should include 6400 but not 8100 (one digit is odd) or 4248 (not a perfect square).}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   219
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   220
\inctime{15}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   221
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   222
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   223
\section{Modules}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   224
\begin{frame}[fragile]
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   225
  \frametitle{\texttt{from} \ldots \texttt{import} magic}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   226
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   227
from scipy.integrate import odeint
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   228
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   229
from scipy.optimize import fsolve
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   230
  \end{lstlisting}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   231
\emphbar{Above statements import a function to our namespace}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   232
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   233
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   234
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   235
  \frametitle{Running scripts from command line}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   236
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   237
  \begin{itemize}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   238
    \item Fire up a terminal
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   239
    \item python four\_plot.py
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   240
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   241
  \pause
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   242
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   243
Traceback (most recent call last):
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   244
  File "four_plot.py", line 1, in <module>
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   245
    x = linspace(-5*pi, 5*pi, 500)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   246
NameError: name 'linspace' is not defined
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   247
  \end{lstlisting}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   248
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   249
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   250
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   251
  \frametitle{Remedy}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   252
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   253
from scipy import *
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   254
  \end{lstlisting}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   255
\alert{Now run python four\_plot.py again!}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   256
  \pause
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   257
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   258
Traceback (most recent call last):
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   259
  File "four_plot.py", line 4, in <module>
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   260
    plot(x, x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   261
NameError: name 'plot' is not defined
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   262
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   263
\end{frame}
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   264
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   265
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   266
  \frametitle{Remedy \ldots}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   267
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   268
from pylab import *
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   269
  \end{lstlisting}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   270
\alert{Now run python four\_plot.py again!!}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   271
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   272
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   273
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   274
  \frametitle{Modules}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   275
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   276
    \item The \kwrd{import} keyword ``loads'' a module
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   277
    \item One can also use:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   278
      \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   279
In []: from scipy import *
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   280
In []: from scipy import linspace
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   281
      \end{lstlisting}    
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   282
    \item What is the difference?
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   283
    \item \alert{Use the former only in interactive mode}
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   284
    \end{itemize}
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   285
\end{frame}
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   286
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   287
\begin{frame}[fragile]
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   288
  \frametitle{Package hierarchies}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   289
  \begin{lstlisting}
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   290
from scipy.integrate import odeint
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 256
diff changeset
   291
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   292
from scipy.optimize import fsolve
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   293
  \end{lstlisting}
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   294
\end{frame}
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   295
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   296
\begin{frame}[fragile]
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   297
  \frametitle{\texttt{from} \ldots \texttt{import} - conventional way!}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   298
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   299
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   300
from scipy import linspace, pi, sin
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   301
from pylab import plot, legend, annotate
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   302
from pylab import xlim, ylim
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   303
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   304
x = linspace(-5*pi, 5*pi, 500)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   305
plot(x, x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   306
plot(x, -x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   307
plot(x, sin(x), 'g', linewidth=2)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   308
plot(x, x*sin(x), 'r', linewidth=3)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   309
legend(['x', '-x', 'sin(x)', 'xsin(x)'])
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   310
annotate('origin', xy = (0, 0))
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   311
xlim(-5*pi, 5*pi)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   312
ylim(-5*pi, 5*pi)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   313
  \end{lstlisting}
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   314
\end{frame}
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   315
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   316
\begin{frame}[fragile]
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   317
  \frametitle{\texttt{from} \ldots \texttt{import} - conventional way!}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   318
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   319
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   320
import scipy
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   321
import pylab
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   322
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   323
x = scipy.linspace(-5*scipy.pi, 5*scipy.pi, 500)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   324
pylab.plot(x, x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   325
pylab.plot(x, -x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   326
pylab.plot(x, scipy.sin(x), 'g', linewidth=2)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   327
pylab.plot(x, x*scipy.sin(x), 'r', linewidth=3)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   328
pylab.legend(['x', '-x', 'sin(x)', 'xsin(x)'])
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   329
pylab.annotate('origin', xy = (0, 0))
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   330
pylab.xlim(-5*scipy.pi, 5*scipy.pi)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   331
pylab.ylim(-5*scipy.pi, 5*scipy.pi)
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   332
  \end{lstlisting}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   333
\end{frame}
219
f6725f6bee41 Session 4, Debugging and Testing.
Shantanu <shantanu@fossee.in>
parents: 215
diff changeset
   334
f6725f6bee41 Session 4, Debugging and Testing.
Shantanu <shantanu@fossee.in>
parents: 215
diff changeset
   335
\begin{frame}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   336
  \frametitle{Modules: Standard library}
220
15306dad3b81 Corrections to day1 Session1, day2 Session 3 and 4.
Shantanu <shantanu@fossee.in>
parents: 219
diff changeset
   337
  \begin{itemize}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   338
  \item Very powerful, ``Batteries included''
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   339
  \item Some standard modules:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   340
    \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   341
    \item Math: \typ{math}, \typ{random}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   342
    \item Internet access: \typ{urllib2}, \typ{smtplib}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   343
    \item System, Command line arguments: \typ{sys}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   344
    \item Operating system interface: \typ{os}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   345
    \item Regular expressions: \typ{re}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   346
    \item Compression: \typ{gzip}, \typ{zipfile}, and \typ{tarfile}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   347
    \item And a whole lot more!
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   348
    \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   349
  \item Check out the Python Library reference:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   350
    \url{http://docs.python.org/library/}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   351
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   352
\inctime{5}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   353
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   354
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   355
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   356
  \frametitle{Modules of special interest}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   357
  \begin{description}[matplotlibfor2d]
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   358
    \item[\texttt{pylab}] Easy, interactive, 2D plotting
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   359
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   360
    \item[\texttt{scipy}] arrays, statistics, optimization, integration, linear
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   361
            algebra, Fourier transforms, signal and image processing,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   362
            genetic algorithms, ODE solvers, special functions, and more
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   363
297
a835affb1447 Added final changes to all day 2 slides for Calicut workshop.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 288
diff changeset
   364
    \item[\texttt{Mayavi}] Easy, interactive, 3D plotting
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   365
  \end{description}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   366
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   367
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   368
\section{Objects}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   369
\begin{frame}{Everything is an Object!}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   370
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   371
    \item \typ{int}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   372
    \item \typ{float}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   373
    \item \typ{str}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   374
    \item \typ{list}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   375
    \item \typ{tuple}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   376
    \item \typ{string}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   377
    \item \typ{dictionary}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   378
    \item \typ{function}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   379
    \item User defined class is also an object!
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   380
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   381
\end {frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   382
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   383
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   384
\frametitle{Using Objects}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   385
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   386
    \item Creating Objects
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   387
    \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   388
      \item Initialization
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   389
    \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   390
    \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   391
In []: a = str()
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   392
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   393
In []: b = "Hello World"
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   394
    \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   395
    \item Object Manipulation
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   396
    \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   397
      \item Object methods
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   398
      \item ``.'' operator
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   399
    \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   400
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   401
In []: "Hello World".split()
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   402
Out[]: ['Hello', 'World']
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   403
    \end{lstlisting}
220
15306dad3b81 Corrections to day1 Session1, day2 Session 3 and 4.
Shantanu <shantanu@fossee.in>
parents: 219
diff changeset
   404
  \end{itemize}
219
f6725f6bee41 Session 4, Debugging and Testing.
Shantanu <shantanu@fossee.in>
parents: 215
diff changeset
   405
\end{frame}
220
15306dad3b81 Corrections to day1 Session1, day2 Session 3 and 4.
Shantanu <shantanu@fossee.in>
parents: 219
diff changeset
   406
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   407
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   408
  \frametitle{Objects provide consistency}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   409
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   410
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   411
for element in (1, 2, 3):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   412
    print element
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   413
for key in {'one':1, 'two':2}:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   414
    print key
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   415
for char in "123":
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   416
    print char
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   417
for line in open("myfile.txt"):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   418
    print line
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   419
for line in urllib2.urlopen('http://site.com'):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   420
    print line
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   421
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   422
  \inctime{10}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   423
\end{frame}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   424
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   425
\begin{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   426
  \frametitle{What did we learn?}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   427
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   428
    \item Functions: Default and Keyword arguments
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   429
    \item Modules
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   430
    \item Objects
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   431
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   432
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   433
330
46533051b9d3 commited changes made for scipy and cheatsheats.
Shantanu <shantanu@fossee.in>
parents: 300
diff changeset
   434
\end{document}